Merge branch 'nd/ita-empty-commit'
authorJunio C Hamano <gitster@pobox.com>
Thu, 27 Oct 2016 21:58:50 +0000 (14:58 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Oct 2016 21:58:50 +0000 (14:58 -0700)
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"

1  2 
Documentation/diff-options.txt
builtin/commit.c
diff.c
diff.h
sequencer.c
wt-status.c
Simple merge
Simple merge
diff --cc diff.c
index 4c09314cc7970788382a01c6ff839563d4563241,297e0340e93cdf3e14be14f03d41506756d48511..8981477c436dd11d97714f0ad7e1b9363e328798
--- 1/diff.c
--- 2/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 diff.h
Simple merge
diff --cc sequencer.c
index a61fe76f98f0a5805bb75e9b5c40c39b4b750498,b0826353e31ecbc47774addfe7a4358fa9c89bc7..5fd75f30dd4455bf71a12fd628b488fc2b17e192
@@@ -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)
diff --cc wt-status.c
Simple merge