contrib: Avoid redundant 'git diff' in prepare-commit-msg hook
contrib/ChangeLog: * prepare-commit-msg: Use 'tee' to save the diff to a file instead of running 'git diff' twice.
This commit is contained in:
parent
656e363bcc
commit
9aadfdd650
|
@ -59,7 +59,9 @@ fi
|
|||
|
||||
# Save diff to a file if requested.
|
||||
if ! [ -z "$GCC_GIT_DIFF_FILE" ]; then
|
||||
git $cmd > "$GCC_GIT_DIFF_FILE";
|
||||
tee="tee $GCC_GIT_DIFF_FILE"
|
||||
else
|
||||
tee="cat"
|
||||
fi
|
||||
|
||||
git $cmd | git gcc-mklog -c "$COMMIT_MSG_FILE"
|
||||
git $cmd | $tee | git gcc-mklog -c "$COMMIT_MSG_FILE"
|
||||
|
|
Loading…
Reference in New Issue