Fourth batch
[gitweb.git] / t / t2202-add-addremove.sh
index 6a8151064c8256bd03a90460eb1bd6970428f2f0..9ee659098c45fbc18dfb5ccc2292f978320c1ebb 100755 (executable)
@@ -6,14 +6,15 @@ test_description='git add --all'
 
 test_expect_success setup '
        (
-               echo .gitignore
+               echo .gitignore &&
                echo will-remove
        ) >expect &&
        (
-               echo actual
-               echo expect
+               echo actual &&
+               echo expect &&
                echo ignored
        ) >.gitignore &&
+       git --literal-pathspecs add --all &&
        >will-remove &&
        git add --all &&
        test_tick &&
@@ -24,10 +25,10 @@ test_expect_success setup '
 
 test_expect_success 'git add --all' '
        (
-               echo .gitignore
-               echo not-ignored
-               echo "M .gitignore"
-               echo "A not-ignored"
+               echo .gitignore &&
+               echo not-ignored &&
+               echo "M .gitignore" &&
+               echo "A not-ignored" &&
                echo "D will-remove"
        ) >expect &&
        >ignored &&
@@ -41,4 +42,13 @@ test_expect_success 'git add --all' '
        test_cmp expect actual
 '
 
+test_expect_success 'Just "git add" is a no-op' '
+       git reset --hard &&
+       echo >will-remove &&
+       >will-not-be-added &&
+       git add &&
+       git diff-index --name-status --cached HEAD >actual &&
+       test_must_be_empty actual
+'
+
 test_done