Commit d6cb3a6
t/t-checkout.sh: test exit code from checkout
In commit 8e9fbf4 of PR git-lfs#2626 we
updated several commands, including "git lfs checkout" and "git lfs pull",
to report an error if the Git LFS "clean" filter is not installed, and
we added tests to validate this new behaviour in the same commit.
Two of these tests, the "clone (without clean filter)" and "pull without
clean filter" tests in our t/t-clone.sh and t/t-pull.sh test scripts,
respectively, perform the appropriate Git LFS command and log its output
to a file. They next confirm that the command's exit code was zero
by checking the first element of the PIPESTATUS shell array variable.
Next, they run a grep(1) command to confirm that the string "Git LFS is
not installed" appears the output captured from Git LFS command.
However, the third of these tests, the "checkout: without clean filter"
test in our t/t-checkout.sh test script, reverses the order of its two
checks, which means that the value in the PIPESTATUS shell array variable
is only the exit code from the grep(1) command, and not the exit code
from the preceding "git lfs checkout" command. Since we expect the
"git lfs checkout" command to return a zero exit code (despite the
warning message), the test inadvertently passes because the grep(2)
command also runs successfully and returns zero.
We therefore move the grep(2) command in the "checkout: without clean
filter" test to follow the check of the PIPESTATUS array variable,
matching the design of the other two related tests.1 parent 47ccbff commit d6cb3a6
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | 181 | | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
0 commit comments