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
1 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue