Skip to content

Commit ecb590a

Browse files
peffgitster
authored andcommitted
perf-lib: fix ignored exit code inside loop
When copying the test repository, we try to detect whether the copy succeeded. However, most of the heavy lifting is done inside a for loop, where our "break" will lose the exit code of the failing "cp". We can take advantage of the fact that we are in a subshell, and just "exit 1" to break out with a code. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 65e6758 commit ecb590a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/perf/perf-lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ test_perf_create_repo_from () {
9191
*/objects|*/hooks|*/config)
9292
;;
9393
*)
94-
cp -R "$stuff" . || break
94+
cp -R "$stuff" . || exit 1
9595
;;
9696
esac
9797
done &&

0 commit comments

Comments
 (0)