For shell scripts, the usual convention is for there to be no space
after redirection operators, (e.g. `>file`, not `> file`). Remove these
spaces wherever they appear.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
. ./test-lib.sh
test_expect_success 'stash save --include-untracked some dirty working directory' '
. ./test-lib.sh
test_expect_success 'stash save --include-untracked some dirty working directory' '
git add file &&
test_tick &&
git commit -m initial &&
git add file &&
test_tick &&
git commit -m initial &&
- echo 1 > file2 &&
- echo 1 > HEAD &&
+ echo 1 >file2 &&
+ echo 1 >HEAD &&
mkdir untracked &&
echo untracked >untracked/untracked &&
git stash --include-untracked &&
mkdir untracked &&
echo untracked >untracked/untracked &&
git stash --include-untracked &&
git diff-index --cached --quiet HEAD
'
git diff-index --cached --quiet HEAD
'
tracked=$(git rev-parse --short $(echo 1 | git hash-object --stdin))
untracked=$(git rev-parse --short $(echo untracked | git hash-object --stdin))
tracked=$(git rev-parse --short $(echo 1 | git hash-object --stdin))
untracked=$(git rev-parse --short $(echo untracked | git hash-object --stdin))
diff --git a/HEAD b/HEAD
new file mode 100644
index 0000000..$tracked
diff --git a/HEAD b/HEAD
new file mode 100644
index 0000000..$tracked
@@ -0,0 +1 @@
+untracked
EOF
@@ -0,0 +1 @@
+untracked
EOF
-cat > expect.lstree <<EOF
+cat >expect.lstree <<EOF
git clean --force --quiet
git clean --force --quiet
git clean --force --quiet -d
test_expect_success 'stash save -u dirty index' '
git clean --force --quiet -d
test_expect_success 'stash save -u dirty index' '
git add file3 &&
test_tick &&
git stash -u
'
blob=$(git rev-parse --short $(echo 4 | git hash-object --stdin))
git add file3 &&
test_tick &&
git stash -u
'
blob=$(git rev-parse --short $(echo 4 | git hash-object --stdin))
diff --git a/file3 b/file3
new file mode 100644
index 0000000..$blob
diff --git a/file3 b/file3
new file mode 100644
index 0000000..$blob
# Must direct output somewhere where it won't be considered an untracked file
test_expect_success 'stash save --include-untracked -q is quiet' '
# Must direct output somewhere where it won't be considered an untracked file
test_expect_success 'stash save --include-untracked -q is quiet' '
- echo 1 > file5 &&
- git stash save --include-untracked --quiet > .git/stash-output.out 2>&1 &&
+ echo 1 >file5 &&
+ git stash save --include-untracked --quiet >.git/stash-output.out 2>&1 &&
test_line_count = 0 .git/stash-output.out &&
rm -f .git/stash-output.out
'
test_line_count = 0 .git/stash-output.out &&
rm -f .git/stash-output.out
'
test_expect_success 'stash save --include-untracked removed files' '
rm -f file &&
git stash save --include-untracked &&
test_expect_success 'stash save --include-untracked removed files' '
rm -f file &&
git stash save --include-untracked &&
test_path_is_missing file
'
test_path_is_missing file
'
.gitignore
ignored
ignored.d/
EOF
test_expect_success 'stash save --include-untracked respects .gitignore' '
.gitignore
ignored
ignored.d/
EOF
test_expect_success 'stash save --include-untracked respects .gitignore' '
- echo ignored > ignored &&
+ echo ignored >ignored &&
mkdir ignored.d &&
echo ignored >ignored.d/untracked &&
git stash -u &&
mkdir ignored.d &&
echo ignored >ignored.d/untracked &&
git stash -u &&
'
test_expect_success 'stash save -u can stash with only untracked files different' '
'
test_expect_success 'stash save -u can stash with only untracked files different' '
git stash -u &&
test_path_is_missing file4
'
git stash -u &&
test_path_is_missing file4
'
git add .gitignore &&
git commit -m "Add .gitignore" &&
>ignored.d/foo &&
git add .gitignore &&
git commit -m "Add .gitignore" &&
>ignored.d/foo &&
- echo "!ignored.d/foo" >> .gitignore &&
+ echo "!ignored.d/foo" >>.gitignore &&
git stash save --include-untracked &&
test_path_is_missing ignored.d/foo &&
git stash pop &&
git stash save --include-untracked &&
test_path_is_missing ignored.d/foo &&
git stash pop &&