mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
[PATCH] prepare-commit-msg: Add compatibility check for --default-prefix option
From: Mark Zhuang <mark.zhuang@spacemit.com> The previous commit added --default-prefix to handle non-default git prefix configurations, but this option is not available in older git versions. This patch adds a compatibility check. contrib/ChangeLog: * prepare-commit-msg: check --default-prefix
This commit is contained in:
@@ -78,4 +78,9 @@ else
|
||||
tee="cat"
|
||||
fi
|
||||
|
||||
git $cmd --default-prefix | $tee | git gcc-mklog -c "$COMMIT_MSG_FILE"
|
||||
# Use --default-prefix if supported
|
||||
if git diff --help | grep -q "\-\-default-prefix" 2>/dev/null; then
|
||||
cmd="$cmd --default-prefix"
|
||||
fi
|
||||
|
||||
git $cmd | $tee | git gcc-mklog -c "$COMMIT_MSG_FILE"
|
||||
|
||||
Reference in New Issue
Block a user