summaryrefslogtreecommitdiff
path: root/t/t2200-add-update.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-04-19 19:18:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-09 07:26:56 (GMT)
commit45c45e300bcbe493a39533bb04f6bd548e8a3f19 (patch)
tree5ac08e2d6af81dcbd3c57efdc49e63612bd12640 /t/t2200-add-update.sh
parent300c0a2209b753da1075770f7b696b1814c010f7 (diff)
downloadgit-45c45e300bcbe493a39533bb04f6bd548e8a3f19.zip
git-45c45e300bcbe493a39533bb04f6bd548e8a3f19.tar.gz
git-45c45e300bcbe493a39533bb04f6bd548e8a3f19.tar.bz2
git add: start preparing for "git add <pathspec>..." to default to "-A"
When "git add subdir/" is run without "-u" or "-A" option, e.g. $ edit subdir/x $ create subdir/y $ rm subdir/z $ git add subdir/ the command does not notice removal of paths (e.g. subdir/z) from the working tree. This sometimes confuses new people, as arguably "git add" is told to record the current state of "subdir/" as a whole, not the current state of the paths that exist in the working tree that matches that pathspec (the latter by definition excludes the state of "subdir/z" because it does not exist in the working tree). Plan to eventually make "git add" pretend as if "-A" is given when there is a pathspec on the command line. When resolving a conflict to remove a path, the current code tells you to "git rm $path", but with such a change, you will be able to say "git add $path" (of course you can do "git add -A $path" today). That means that we can simplify the advice messages given by "git status". That all will be in Git 2.0 or later, if we are going to do so. For that transition to work, people need to learn either to say "git add --no-all subdir/" when they want to ignore the removed paths like "subdir/z", or to say "git add -A subdir/" when they want to take the state of the directory as a whole. "git add" without any argument will continue to be a no-op. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2200-add-update.sh')
-rwxr-xr-xt/t2200-add-update.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index 4cdebda..32f932a 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -150,9 +150,9 @@ test_expect_success 'add -u resolves unmerged paths' '
echo 2 >path3 &&
echo 2 >path5 &&
- # Explicit resolving by adding removed paths should fail
- test_must_fail git add path4 &&
- test_must_fail git add path6 &&
+ # Fail to explicitly resolve removed paths with "git add"
+ test_must_fail git add --no-all path4 &&
+ test_must_fail git add --no-all path6 &&
# "add -u" should notice removals no matter what stages
# the index entries are in.