mirror of
https://github.com/git/git
synced 2024-09-17 23:41:33 +00:00
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
This commit is contained in:
commit
f7722a447a
|
@ -336,14 +336,8 @@ int cmd_add(int argc, const char **argv, const char *prefix)
|
||||||
if (!show_only && ignore_missing)
|
if (!show_only && ignore_missing)
|
||||||
die(_("Option --ignore-missing can only be used together with --dry-run"));
|
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;
|
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);
|
hold_locked_index(&lock_file, 1);
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,8 @@ test_expect_success 'non-qualified update in subdir updates from the root' '
|
||||||
(
|
(
|
||||||
cd dir1 &&
|
cd dir1 &&
|
||||||
echo even more >>sub2 &&
|
echo even more >>sub2 &&
|
||||||
|
git --literal-pathspecs add -u &&
|
||||||
|
echo even more >>sub2 &&
|
||||||
git add -u
|
git add -u
|
||||||
) &&
|
) &&
|
||||||
: >expect &&
|
: >expect &&
|
||||||
|
|
|
@ -14,6 +14,7 @@ test_expect_success setup '
|
||||||
echo expect
|
echo expect
|
||||||
echo ignored
|
echo ignored
|
||||||
) >.gitignore &&
|
) >.gitignore &&
|
||||||
|
git --literal-pathspecs add --all &&
|
||||||
>will-remove &&
|
>will-remove &&
|
||||||
git add --all &&
|
git add --all &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
|
|
Loading…
Reference in a new issue