@@ -8,24 +8,24 @@ test_description='Test git stash --include-untracked'
8
8
. ./test-lib.sh
9
9
10
10
test_expect_success ' stash save --include-untracked some dirty working directory' '
11
- echo 1 > file &&
11
+ echo 1 >file &&
12
12
git add file &&
13
13
test_tick &&
14
14
git commit -m initial &&
15
- echo 2 > file &&
15
+ echo 2 >file &&
16
16
git add file &&
17
- echo 3 > file &&
17
+ echo 3 >file &&
18
18
test_tick &&
19
- echo 1 > file2 &&
20
- echo 1 > HEAD &&
19
+ echo 1 >file2 &&
20
+ echo 1 >HEAD &&
21
21
mkdir untracked &&
22
22
echo untracked >untracked/untracked &&
23
23
git stash --include-untracked &&
24
24
git diff-files --quiet &&
25
25
git diff-index --cached --quiet HEAD
26
26
'
27
27
28
- cat > expect << EOF
28
+ cat > expect << EOF
29
29
?? actual
30
30
?? expect
31
31
EOF
@@ -37,7 +37,7 @@ test_expect_success 'stash save --include-untracked cleaned the untracked files'
37
37
38
38
tracked=$( git rev-parse --short $( echo 1 | git hash-object --stdin) )
39
39
untracked=$( git rev-parse --short $( echo untracked | git hash-object --stdin) )
40
- cat > expect.diff << EOF
40
+ cat > expect.diff << EOF
41
41
diff --git a/HEAD b/HEAD
42
42
new file mode 100644
43
43
index 0000000..$tracked
@@ -60,7 +60,7 @@ index 0000000..$untracked
60
60
@@ -0,0 +1 @@
61
61
+untracked
62
62
EOF
63
- cat > expect.lstree << EOF
63
+ cat > expect.lstree << EOF
64
64
HEAD
65
65
file2
66
66
untracked
@@ -85,7 +85,7 @@ test_expect_success 'stash save --patch --all fails' '
85
85
86
86
git clean --force --quiet
87
87
88
- cat > expect << EOF
88
+ cat > expect << EOF
89
89
M file
90
90
?? HEAD
91
91
?? actual
@@ -105,14 +105,14 @@ test_expect_success 'stash pop after save --include-untracked leaves files untra
105
105
git clean --force --quiet -d
106
106
107
107
test_expect_success ' stash save -u dirty index' '
108
- echo 4 > file3 &&
108
+ echo 4 >file3 &&
109
109
git add file3 &&
110
110
test_tick &&
111
111
git stash -u
112
112
'
113
113
114
114
blob=$( git rev-parse --short $( echo 4 | git hash-object --stdin) )
115
- cat > expect << EOF
115
+ cat > expect << EOF
116
116
diff --git a/file3 b/file3
117
117
new file mode 100644
118
118
index 0000000..$blob
@@ -128,20 +128,20 @@ test_expect_success 'stash save --include-untracked dirty index got stashed' '
128
128
test_cmp expect actual
129
129
'
130
130
131
- git reset > /dev/null
131
+ git reset > /dev/null
132
132
133
133
# Must direct output somewhere where it won't be considered an untracked file
134
134
test_expect_success ' stash save --include-untracked -q is quiet' '
135
- echo 1 > file5 &&
136
- git stash save --include-untracked --quiet > .git/stash-output.out 2>&1 &&
135
+ echo 1 >file5 &&
136
+ git stash save --include-untracked --quiet >.git/stash-output.out 2>&1 &&
137
137
test_line_count = 0 .git/stash-output.out &&
138
138
rm -f .git/stash-output.out
139
139
'
140
140
141
141
test_expect_success ' stash save --include-untracked removed files' '
142
142
rm -f file &&
143
143
git stash save --include-untracked &&
144
- echo 1 > expect &&
144
+ echo 1 >expect &&
145
145
test_cmp expect file
146
146
'
147
147
@@ -152,14 +152,14 @@ test_expect_success 'stash save --include-untracked removed files got stashed' '
152
152
test_path_is_missing file
153
153
'
154
154
155
- cat > .gitignore << EOF
155
+ cat > .gitignore << EOF
156
156
.gitignore
157
157
ignored
158
158
ignored.d/
159
159
EOF
160
160
161
161
test_expect_success ' stash save --include-untracked respects .gitignore' '
162
- echo ignored > ignored &&
162
+ echo ignored >ignored &&
163
163
mkdir ignored.d &&
164
164
echo ignored >ignored.d/untracked &&
165
165
git stash -u &&
@@ -169,7 +169,7 @@ test_expect_success 'stash save --include-untracked respects .gitignore' '
169
169
'
170
170
171
171
test_expect_success ' stash save -u can stash with only untracked files different' '
172
- echo 4 > file4 &&
172
+ echo 4 >file4 &&
173
173
git stash -u &&
174
174
test_path_is_missing file4
175
175
'
@@ -214,7 +214,7 @@ test_expect_success 'stash push with $IFS character' '
214
214
test_path_is_file bar
215
215
'
216
216
217
- cat > .gitignore << EOF
217
+ cat > .gitignore << EOF
218
218
ignored
219
219
ignored.d/*
220
220
EOF
@@ -224,7 +224,7 @@ test_expect_success 'stash previously ignored file' '
224
224
git add .gitignore &&
225
225
git commit -m "Add .gitignore" &&
226
226
>ignored.d/foo &&
227
- echo "!ignored.d/foo" >> .gitignore &&
227
+ echo "!ignored.d/foo" >>.gitignore &&
228
228
git stash save --include-untracked &&
229
229
test_path_is_missing ignored.d/foo &&
230
230
git stash pop &&
0 commit comments