Commit 250c94d8 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[#1042] prepare-commit-msg updated

parent 1157db46
#!/bin/sh
BRANCH=`git branch | grep '^\*' | cut -b3-`
ISSUE=`git branch | grep -o '^\* [0-9]*' | cut -b3-`
if test "$BRANCH" == "master"; then
echo "ERROR: You are on branch $BRANCH"
......@@ -9,7 +10,11 @@ if test "$BRANCH" == "master"; then
exit 1
fi
BRANCH_NUMBER=`git branch | grep -o '^\* [0-9]*' | cut -b3-`
/bin/echo -n "[#$BRANCH_NUMBER] " > "$1.msg"
if [ -n "$ISSUE" ]; then
/bin/echo -n "[#$ISSUE] " > "$1.msg"
else
/bin/echo -n "[$BRANCH] " > "$1.msg"
fi
cat "$1" >> "$1.msg"
mv "$1.msg" "$1"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment