summaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-30 20:06:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-30 20:06:55 (GMT)
commitf7722a447ab6121f0567cb7f211093983c300a97 (patch)
treed03a4bebcfa68b24ab1706173f875f12cb1aca51 /builtin/add.c
parent908700c0082487f9c859b951370148ff7e8acb97 (diff)
parent29abb33978f713cd0a5cc3687bf61077b0928840 (diff)
downloadgit-f7722a447ab6121f0567cb7f211093983c300a97.zip
git-f7722a447ab6121f0567cb7f211093983c300a97.tar.gz
git-f7722a447ab6121f0567cb7f211093983c300a97.tar.bz2
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
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/builtin/add.c b/builtin/add.c
index b2a5c57..145f06e 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -336,14 +336,8 @@ int cmd_add(int argc, const char **argv, const char *prefix)
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));
hold_locked_index(&lock_file, 1);