Skip to content

Commit

Permalink
lib_util: diff_colorized always exits 0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
spiffxp committed Mar 17, 2021
1 parent ed4e5eb commit 344dd4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion infra/gcp/lib_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 344dd4b

Please sign in to comment.