From 344dd4bd8ffac459768bbff651dcdd68985cd0f6 Mon Sep 17 00:00:00 2001 From: Aaron Crickenberger Date: Wed, 17 Mar 2021 10:22:48 -0400 Subject: [PATCH] lib_util: diff_colorized always exits 0 Since diff_colorized is intended for human consumption (log output), always return true so that diff output doesn't cause things to halt. Somehow I thought `git diff` was always exiting with 0, regardless of whether the two files differed or not. Turns out it _will_ exit non-zero if files differ. --- infra/gcp/lib_util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/gcp/lib_util.sh b/infra/gcp/lib_util.sh index 5418b4f5e1b..f06e39f4e40 100755 --- a/infra/gcp/lib_util.sh +++ b/infra/gcp/lib_util.sh @@ -110,5 +110,5 @@ function join_by() { # use git-diff for color output, strip patch header function diff_colorized() { - git --no-pager diff --color --no-prefix --no-index "$@" | tail -n+5 + (git --no-pager diff --color --no-prefix --no-index "$@" | tail -n+5) || true }