From: Junio C Hamano Date: Fri, 30 Oct 2015 20:06:55 +0000 (-0700) Subject: Merge branch 'jc/add-u-A-default-to-top' X-Git-Tag: v2.7.0-rc0~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7722a447ab6121f0567cb7f211093983c300a97;p=git Merge branch 'jc/add-u-A-default-to-top' "git --literal-pathspecs add -u/-A" without any command line argument misbehaved ever since Git 2.0. * jc/add-u-A-default-to-top: add: simplify -u/-A without pathspec --- f7722a447ab6121f0567cb7f211093983c300a97 diff --cc builtin/add.c index b2a5c57f0a,06ad3653f0..145f06ef97 --- a/builtin/add.c +++ b/builtin/add.c @@@ -336,16 -336,10 +336,10 @@@ int cmd_add(int argc, const char **argv if (!show_only && ignore_missing) die(_("Option --ignore-missing can only be used together with --dry-run")); - if ((0 < addremove_explicit || take_worktree_changes) && !argc) { - static const char *whole[2] = { ":/", NULL }; - argc = 1; - argv = whole; - } - add_new_files = !take_worktree_changes && !refresh_only; - require_pathspec = !take_worktree_changes; + require_pathspec = !(take_worktree_changes || (0 < addremove_explicit)); - newfd = hold_locked_index(&lock_file, 1); + hold_locked_index(&lock_file, 1); flags = ((verbose ? ADD_CACHE_VERBOSE : 0) | (show_only ? ADD_CACHE_PRETEND : 0) |