Skip to content

Commit 32fa15a

Browse files
authored
fixed the case where the prefix of the tag could conflict
1 parent 2335dfc commit 32fa15a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

git-autotag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
TARGET_PREFIX=${1:-release}
44
TARGET_BASE=$TARGET_PREFIX-`date +%Y%m%d`
5-
TARGET_REVISION=$((`git ls-remote --tags --heads origin | awk "/$TARGET_BASE-(.*)/ { print $1 }" | awk -F'-' '{print $3}' | sort -nr | head -n 1` + 1))
5+
TARGET_REVISION=$((`git ls-remote --tags --heads origin | awk "/tags\/$TARGET_BASE-(.*)/ { print $1 }" | awk -F'-' '{print $3}' | sort -nr | head -n 1` + 1))
66
TARGET_BRANCH=$TARGET_BASE-$TARGET_REVISION
77
git tag $TARGET_BRANCH
88
git push origin $TARGET_BRANCH

0 commit comments

Comments
 (0)