From: Junio C Hamano Date: Thu, 27 Oct 2016 21:58:50 +0000 (-0700) Subject: Merge branch 'nd/ita-empty-commit' X-Git-Tag: v2.11.0-rc0~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=650360210afbd585f33ed622d3e700b1941b1ddb;p=thirdparty%2Fgit.git Merge branch 'nd/ita-empty-commit' When new paths were added by "git add -N" to the index, it was enough to circumvent the check by "git commit" to refrain from making an empty commit without "--allow-empty". The same logic prevented "git status" to show such a path as "new file" in the "Changes not staged for commit" section. * nd/ita-empty-commit: commit: don't be fooled by ita entries when creating initial commit commit: fix empty commit creation when there's no changes but ita entries diff: add --ita-[in]visible-in-index diff-lib: allow ita entries treated as "not yet exist in index" --- 650360210afbd585f33ed622d3e700b1941b1ddb diff --cc diff.c index 4c09314cc7,297e0340e9..8981477c43 --- a/diff.c +++ b/diff.c @@@ -3986,7 -3950,11 +3986,11 @@@ int diff_opt_parse(struct diff_options else if (skip_prefix(arg, "--submodule=", &arg)) return parse_submodule_opt(options, arg); else if (skip_prefix(arg, "--ws-error-highlight=", &arg)) - return parse_ws_error_highlight(options, arg); + return parse_ws_error_highlight_opt(options, arg); + else if (!strcmp(arg, "--ita-invisible-in-index")) + options->ita_invisible_in_index = 1; + else if (!strcmp(arg, "--ita-visible-in-index")) + options->ita_invisible_in_index = 0; /* misc options */ else if (!strcmp(arg, "-z")) diff --cc sequencer.c index a61fe76f98,b0826353e3..5fd75f30dd --- a/sequencer.c +++ b/sequencer.c @@@ -1308,19 -1060,14 +1308,19 @@@ int sequencer_continue(struct replay_op /* Verify that the conflict has been resolved */ if (file_exists(git_path_cherry_pick_head()) || file_exists(git_path_revert_head())) { - int ret = continue_single_pick(); - if (ret) - return ret; + res = continue_single_pick(); + if (res) + goto release_todo_list; } - if (index_differs_from("HEAD", 0)) { - if (index_differs_from("HEAD", 0, 0)) - return error_dirty_index(opts); - todo_list = todo_list->next; - return pick_commits(todo_list, opts); ++ if (index_differs_from("HEAD", 0, 0)) { + res = error_dirty_index(opts); + goto release_todo_list; + } + todo_list.current++; + res = pick_commits(&todo_list, opts); +release_todo_list: + todo_list_release(&todo_list); + return res; } static int single_pick(struct commit *cmit, struct replay_opts *opts)