summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-11-05 12:18:12 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-11-05 12:18:12 -0800
commita878e7e62b4826a95effa1420cff47807f9cb88b (patch)
tree15594eb261507877e60e1a35a4b62371b270f90d /builtin
parentMerge branch 'jk/delete-modechange-conflict' into maint (diff)
parentadd: simplify -u/-A without pathspec (diff)
downloadtgif-a878e7e62b4826a95effa1420cff47807f9cb88b.tar.xz
Merge branch 'jc/add-u-A-default-to-top' into maint
"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')
-rw-r--r--builtin/add.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/builtin/add.c b/builtin/add.c
index b2a5c57f0a..145f06ef97 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);