diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/add.c | 4 | ||||
-rw-r--r-- | builtin/apply.c | 4 | ||||
-rw-r--r-- | builtin/blame.c | 10 | ||||
-rw-r--r-- | builtin/branch.c | 4 | ||||
-rw-r--r-- | builtin/cat-file.c | 4 | ||||
-rw-r--r-- | builtin/checkout.c | 3 | ||||
-rw-r--r-- | builtin/commit.c | 9 | ||||
-rw-r--r-- | builtin/fetch.c | 6 | ||||
-rw-r--r-- | builtin/help.c | 2 | ||||
-rw-r--r-- | builtin/mailinfo.c | 4 | ||||
-rw-r--r-- | builtin/receive-pack.c | 2 | ||||
-rw-r--r-- | builtin/remote.c | 11 |
12 files changed, 38 insertions, 25 deletions
diff --git a/builtin/add.c b/builtin/add.c index 87d2980313..17149cfeed 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 8fc5ec31de..562e5345fc 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 8506286dd2..729b43058a 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 6cf7e721e6..f594af0b3b 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 a933eaa043..e5118c57da 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 72e4fbc729..1994be92c6 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 a861686643..0e3ae3c11d 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 8470850415..5cb369cfd1 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 3182a2bec4..a9836b00ae 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 4a9729b9b3..2320d981ce 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 bb34757d27..5a75af4155 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 4745957b96..0a52667e0f 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); |