From 5cb2b8c2359e3402a7f4122c2a1acb235a8f30d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Thu, 25 Apr 2019 19:15:43 +0200 Subject: [PATCH] Use latest upstream instead of local branch for tags (#153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to avoid accidentally tagging the wrong commit if the wrong branch is checked out. Signed-off-by: Reinhard Nägele --- tag.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tag.sh b/tag.sh index f635fd0d..8a5c0392 100755 --- a/tag.sh +++ b/tag.sh @@ -97,7 +97,8 @@ main() { pushd "$SCRIPT_DIR" > /dev/null - git tag -a -m "Release $tag" "$tag" "${force[@]}" + git fetch "$remote" + git tag -a -m "Release $tag" "$tag" "$remote/master" "${force[@]}" if [[ -z "$skip_push" ]]; then git push "$remote" "refs/tags/$tag" "${force[@]}"