Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion commit_msg_issue_number_prepend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ fi


if [ -n "$ISSUE_NUMBER" ]; then
echo "$REPO_PREPEND#$ISSUE_NUMBER" `cat $1` > "$1"
COMMIT_MSG=$(cat "$1")
# Check if issue number is already in the commit message
if echo "$COMMIT_MSG" | grep -qE "(^|[^0-9])#$ISSUE_NUMBER([^0-9]|$)"; then
exit 0
fi
echo "$REPO_PREPEND#$ISSUE_NUMBER" "$COMMIT_MSG" > "$1"
fi
Loading