prepare-commit-msg: Save diff if requested by user.
authorMartin Liska <mliska@suse.cz>
Tue, 26 May 2020 07:08:31 +0000 (09:08 +0200)
committerMartin Liska <mliska@suse.cz>
Wed, 27 May 2020 08:12:58 +0000 (10:12 +0200)
contrib/ChangeLog:

* prepare-commit-msg: Save diff to a file if
the GCC_GIT_DIFF_FILE variable is set.

contrib/prepare-commit-msg

index 820dacc7e42c60612c39be4c78f8c024ff83edc1..fd59bfbcf8837335cf5b095f2cfb267e1c7e9a17 100755 (executable)
@@ -54,4 +54,9 @@ else
     exit 0
 fi
 
+# Save diff to a file if requested.
+if ! [ -z "$GCC_GIT_DIFF_FILE" ]; then
+  git $cmd > "$GCC_GIT_DIFF_FILE";
+fi
+
 git $cmd | git gcc-mklog -c "$COMMIT_MSG_FILE"