From e0e66852d5576558a860309dad3152cf61b1dd7c Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 8 Oct 2013 21:23:23 +0200 Subject: build-snapshot: Don't forget to checkout branch Fix the issue that the build-snapshot script failed to checkout existing branches. diff --git a/bin/build-snapshot b/bin/build-snapshot index 5633abd..e6b4082 100755 --- a/bin/build-snapshot +++ b/bin/build-snapshot @@ -38,8 +38,12 @@ create_snapshot() branch=$1 snapshot_dir=$2 - git show-ref --verify --quiet "refs/heads/$branch" \ - || git checkout --quiet --track "origin/$branch" + if git show-ref --verify --quiet "refs/heads/$branch" + then + git checkout --quiet "$branch" + else + git checkout --quiet --track "origin/$branch" + fi version=$(git describe --abbrev=4 'HEAD' | sed 's/release-//') tarball="nagios-plugins-$version.tar.gz" -- cgit v0.10-9-g596f