Browse Source
The exit status of the `&` asynchronous operator which starts a command in the background is unconditionally zero, and the few places in the test scripts which launch commands asynchronously are not interested in the exit status of the `&` operator (though they often capture the background command's PID). As such, there is little value in complaining about broken &&-chain for a command launched in the background, and doing so would only make busy-work for test authors. Therefore, take this special case into account when checking for &&-chain breakage. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
![sunshine@sunshineco.com](/assets/img/avatar_default.png)
![Junio C Hamano](/assets/img/avatar_default.png)
3 changed files with 20 additions and 1 deletions
@ -0,0 +1,9 @@ |
|||||||
|
JGIT_DAEMON_PID= && |
||||||
|
git init --bare empty.git && |
||||||
|
> empty.git/git-daemon-export-ok && |
||||||
|
mkfifo jgit_daemon_output && |
||||||
|
{ |
||||||
|
jgit daemon --port="$JGIT_DAEMON_PORT" . > jgit_daemon_output & |
||||||
|
JGIT_DAEMON_PID=$! |
||||||
|
} && |
||||||
|
test_expect_code 2 git ls-remote --exit-code git://localhost:$JGIT_DAEMON_PORT/empty.git |
@ -0,0 +1,10 @@ |
|||||||
|
JGIT_DAEMON_PID= && |
||||||
|
git init --bare empty.git && |
||||||
|
>empty.git/git-daemon-export-ok && |
||||||
|
mkfifo jgit_daemon_output && |
||||||
|
{ |
||||||
|
# LINT: exit status of "&" is always 0 so &&-chaining immaterial |
||||||
|
jgit daemon --port="$JGIT_DAEMON_PORT" . >jgit_daemon_output & |
||||||
|
JGIT_DAEMON_PID=$! |
||||||
|
} && |
||||||
|
test_expect_code 2 git ls-remote --exit-code git://localhost:$JGIT_DAEMON_PORT/empty.git |
Loading…
Reference in new issue