aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-21 06:02:44 -0700
committerJunio C Hamano <gitster@pobox.com>2010-06-21 06:02:44 -0700
commit8d676d85f772ce3a100b6f0dddd1c34a7e4313cf (patch)
treeb6fa143842fc72a3bb2079dfdb66f30ce5126319 /builtin
parent919e06b2288270f47c55759e8810b87f74609caf (diff)
parent5e87eae97df69a48a575fd79131e85067f9dbf13 (diff)
downloadgit-8d676d85f772ce3a100b6f0dddd1c34a7e4313cf.tar.gz
git-8d676d85f772ce3a100b6f0dddd1c34a7e4313cf.tar.xz
Merge branch 'gv/portable'
* gv/portable: test-lib: use DIFF definition from GIT-BUILD-OPTIONS build: propagate $DIFF to scripts Makefile: Tru64 portability fix Makefile: HP-UX 10.20 portability fixes Makefile: HPUX11 portability fixes Makefile: SunOS 5.6 portability fix inline declaration does not work on AIX Allow disabling "inline" Some platforms lack socklen_t type Make NO_{INET_NTOP,INET_PTON} configured independently Makefile: some platforms do not have hstrerror anywhere git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition test_cmp: do not use "diff -u" on platforms that lack one fixup: do not unconditionally disable "diff -u" tests: use "test_cmp", not "diff", when verifying the result Do not use "diff" found on PATH while building and installing enums: omit trailing comma for portability Makefile: -lpthread may still be necessary when libc has only pthread stubs Rewrite dynamic structure initializations to runtime assignment Makefile: pass CPPFLAGS through to fllow customization Conflicts: Makefile wt-status.h
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c4
-rw-r--r--builtin/apply.c4
-rw-r--r--builtin/blame.c10
-rw-r--r--builtin/branch.c4
-rw-r--r--builtin/cat-file.c4
-rw-r--r--builtin/checkout.c3
-rw-r--r--builtin/commit.c9
-rw-r--r--builtin/fetch.c6
-rw-r--r--builtin/help.c2
-rw-r--r--builtin/mailinfo.c4
-rw-r--r--builtin/receive-pack.c2
-rw-r--r--builtin/remote.c11
12 files changed, 38 insertions, 25 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 87d298031..17149cfee 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -261,12 +261,14 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
{
char *file = xstrdup(git_path("ADD_EDIT.patch"));
const char *apply_argv[] = { "apply", "--recount", "--cached",
- file, NULL };
+ NULL, NULL };
struct child_process child;
struct rev_info rev;
int out;
struct stat st;
+ apply_argv[3] = file;
+
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
if (read_cache() < 0)
diff --git a/builtin/apply.c b/builtin/apply.c
index 8fc5ec31d..562e5345f 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -56,7 +56,7 @@ static enum ws_error_action {
nowarn_ws_error,
warn_on_ws_error,
die_on_ws_error,
- correct_ws_error,
+ correct_ws_error
} ws_error_action = warn_on_ws_error;
static int whitespace_error;
static int squelch_whitespace_errors = 5;
@@ -64,7 +64,7 @@ static int applied_after_fixing_ws;
static enum ws_ignore {
ignore_ws_none,
- ignore_ws_change,
+ ignore_ws_change
} ws_ignore_action = ignore_ws_none;
diff --git a/builtin/blame.c b/builtin/blame.c
index 8506286dd..729b43058 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -733,10 +733,11 @@ static int pass_blame_to_parent(struct scoreboard *sb,
{
int last_in_target;
mmfile_t file_p, file_o;
- struct blame_chunk_cb_data d = { sb, target, parent, 0, 0 };
+ struct blame_chunk_cb_data d;
xpparam_t xpp;
xdemitconf_t xecfg;
-
+ memset(&d, 0, sizeof(d));
+ d.sb = sb; d.target = target; d.parent = parent;
last_in_target = find_last_in_target(sb, target);
if (last_in_target < 0)
return 1; /* nothing remains for this target */
@@ -875,10 +876,11 @@ static void find_copy_in_blob(struct scoreboard *sb,
const char *cp;
int cnt;
mmfile_t file_o;
- struct handle_split_cb_data d = { sb, ent, parent, split, 0, 0 };
+ struct handle_split_cb_data d;
xpparam_t xpp;
xdemitconf_t xecfg;
-
+ memset(&d, 0, sizeof(d));
+ d.sb = sb; d.ent = ent; d.parent = parent; d.split = split;
/*
* Prepare mmfile that contains only the lines in ent.
*/
diff --git a/builtin/branch.c b/builtin/branch.c
index 6cf7e721e..f594af0b3 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -43,13 +43,13 @@ enum color_branch {
BRANCH_COLOR_PLAIN = 1,
BRANCH_COLOR_REMOTE = 2,
BRANCH_COLOR_LOCAL = 3,
- BRANCH_COLOR_CURRENT = 4,
+ BRANCH_COLOR_CURRENT = 4
};
static enum merge_filter {
NO_FILTER = 0,
SHOW_NOT_MERGED,
- SHOW_MERGED,
+ SHOW_MERGED
} merge_filter;
static unsigned char merge_filter_ref[20];
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index a933eaa04..e5118c57d 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -118,7 +118,9 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
/* custom pretty-print here */
if (type == OBJ_TREE) {
- const char *ls_args[3] = {"ls-tree", obj_name, NULL};
+ const char *ls_args[3] = { NULL };
+ ls_args[0] = "ls-tree";
+ ls_args[1] = obj_name;
return cmd_ls_tree(2, ls_args, NULL);
}
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 72e4fbc72..1994be92c 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -636,7 +636,8 @@ static int check_tracking_name(const char *refname, const unsigned char *sha1,
static const char *unique_tracking_name(const char *name)
{
- struct tracking_name_data cb_data = { name, NULL, 1 };
+ struct tracking_name_data cb_data = { NULL, NULL, 1 };
+ cb_data.name = name;
for_each_ref(check_tracking_name, &cb_data);
if (cb_data.unique)
return cb_data.remote;
diff --git a/builtin/commit.c b/builtin/commit.c
index a86168664..0e3ae3c11 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -57,7 +57,7 @@ static struct lock_file false_lock; /* used only for partial commits */
static enum {
COMMIT_AS_IS = 1,
COMMIT_NORMAL,
- COMMIT_PARTIAL,
+ COMMIT_PARTIAL
} commit_style;
static const char *logfile, *force_author;
@@ -78,7 +78,7 @@ static char *untracked_files_arg, *force_date;
static enum {
CLEANUP_SPACE,
CLEANUP_NONE,
- CLEANUP_ALL,
+ CLEANUP_ALL
} cleanup_mode;
static char *cleanup_arg;
@@ -91,7 +91,7 @@ static int null_termination;
static enum {
STATUS_FORMAT_LONG,
STATUS_FORMAT_SHORT,
- STATUS_FORMAT_PORCELAIN,
+ STATUS_FORMAT_PORCELAIN
} status_format = STATUS_FORMAT_LONG;
static int status_show_branch;
@@ -732,7 +732,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
if (use_editor) {
char index[PATH_MAX];
- const char *env[2] = { index, NULL };
+ const char *env[2] = { NULL };
+ env[0] = index;
snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", index_file);
if (launch_editor(git_path(commit_editmsg), NULL, env)) {
fprintf(stderr,
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 847085041..5cb369cfd 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -574,9 +574,10 @@ static void find_non_local_tags(struct transport *transport,
{
struct string_list existing_refs = { NULL, 0, 0, 0 };
struct string_list remote_refs = { NULL, 0, 0, 0 };
- struct tag_data data = {head, tail};
+ struct tag_data data;
const struct ref *ref;
struct string_list_item *item = NULL;
+ data.head = head; data.tail = tail;
for_each_ref(add_existing, &existing_refs);
for (ref = transport_get_remote_refs(transport); ref; ref = ref->next) {
@@ -778,7 +779,8 @@ static int get_remote_group(const char *key, const char *value, void *priv)
static int add_remote_or_group(const char *name, struct string_list *list)
{
int prev_nr = list->nr;
- struct remote_group_data g = { name, list };
+ struct remote_group_data g;
+ g.name = name; g.list = list;
git_config(get_remote_group, &g);
if (list->nr == prev_nr) {
diff --git a/builtin/help.c b/builtin/help.c
index 3182a2bec..a9836b00a 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -26,7 +26,7 @@ enum help_format {
HELP_FORMAT_NONE,
HELP_FORMAT_MAN,
HELP_FORMAT_INFO,
- HELP_FORMAT_WEB,
+ HELP_FORMAT_WEB
};
static int show_all = 0;
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index 4a9729b9b..2320d981c 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -17,10 +17,10 @@ static struct strbuf name = STRBUF_INIT;
static struct strbuf email = STRBUF_INIT;
static enum {
- TE_DONTCARE, TE_QP, TE_BASE64,
+ TE_DONTCARE, TE_QP, TE_BASE64
} transfer_encoding;
static enum {
- TYPE_TEXT, TYPE_OTHER,
+ TYPE_TEXT, TYPE_OTHER
} message_type;
static struct strbuf charset = STRBUF_INIT;
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index bb34757d2..5a75af415 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -17,7 +17,7 @@ enum deny_action {
DENY_UNCONFIGURED,
DENY_IGNORE,
DENY_WARN,
- DENY_REFUSE,
+ DENY_REFUSE
};
static int deny_deletes;
diff --git a/builtin/remote.c b/builtin/remote.c
index 4745957b9..0a52667e0 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -348,7 +348,7 @@ struct push_info {
PUSH_STATUS_UPTODATE,
PUSH_STATUS_FASTFORWARD,
PUSH_STATUS_OUTOFDATE,
- PUSH_STATUS_NOTQUERIED,
+ PUSH_STATUS_NOTQUERIED
} status;
};
@@ -736,11 +736,14 @@ static int rm(int argc, const char **argv)
struct known_remotes known_remotes = { NULL, NULL };
struct string_list branches = { NULL, 0, 0, 1 };
struct string_list skipped = { NULL, 0, 0, 1 };
- struct branches_for_remote cb_data = {
- NULL, &branches, &skipped, &known_remotes
- };
+ struct branches_for_remote cb_data;
int i, result;
+ memset(&cb_data, 0, sizeof(cb_data));
+ cb_data.branches = &branches;
+ cb_data.skipped = &skipped;
+ cb_data.keep = &known_remotes;
+
if (argc != 2)
usage_with_options(builtin_remote_rm_usage, options);