aboutsummaryrefslogtreecommitdiff
path: root/t/t3700-add.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-12-23 16:02:41 +0700
committerJunio C Hamano <gitster@pobox.com>2013-12-26 10:46:26 -0800
commit64ed07cee0394509c65331f1e7acb36c58fd18fb (patch)
tree8f97367baeb48a5b6974101f88e3673b80ee54ae /t/t3700-add.sh
parentd2446dfd7f3b3f8948142cfb07a0270e2497d93f (diff)
downloadgit-64ed07cee0394509c65331f1e7acb36c58fd18fb.tar.gz
git-64ed07cee0394509c65331f1e7acb36c58fd18fb.tar.xz
add: don't complain when adding empty project root
This behavior was added in 07d7bed (add: don't complain when adding empty project root - 2009-04-28) then broken by 84b8b5d (remove match_pathspec() in favor of match_pathspec_depth() - 2013-07-14). Reinstate it. Noticed-by: Thomas Ferris Nicolaisen <tfnico@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3700-add.sh')
-rwxr-xr-xt/t3700-add.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index aab86e838..fe274e2fb 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -272,6 +272,25 @@ test_expect_success '"add non-existent" should fail' '
! (git ls-files | grep "non-existent")
'
+test_expect_success 'git add -A on empty repo does not error out' '
+ rm -fr empty &&
+ git init empty &&
+ (
+ cd empty &&
+ git add -A . &&
+ git add -A
+ )
+'
+
+test_expect_success '"git add ." in empty repo' '
+ rm -fr empty &&
+ git init empty &&
+ (
+ cd empty &&
+ git add .
+ )
+'
+
test_expect_success 'git add --dry-run of existing changed file' "
echo new >>track-this &&
git add --dry-run track-this >actual 2>&1 &&