summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/add.c8
-rwxr-xr-xt/t2200-add-update.sh2
-rwxr-xr-xt/t2202-add-addremove.sh1
3 files changed, 4 insertions, 7 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 459208a326..06ad3653f0 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));
newfd = hold_locked_index(&lock_file, 1);
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index e16b15d3e5..314c73c5a7 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -84,6 +84,8 @@ test_expect_success 'non-qualified update in subdir updates from the root' '
(
cd dir1 &&
echo even more >>sub2 &&
+ git --literal-pathspecs add -u &&
+ echo even more >>sub2 &&
git add -u
) &&
: >expect &&
diff --git a/t/t2202-add-addremove.sh b/t/t2202-add-addremove.sh
index fc8b59e7f7..6a5a3166b1 100755
--- a/t/t2202-add-addremove.sh
+++ b/t/t2202-add-addremove.sh
@@ -14,6 +14,7 @@ test_expect_success setup '
echo expect
echo ignored
) >.gitignore &&
+ git --literal-pathspecs add --all &&
>will-remove &&
git add --all &&
test_tick &&