summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/sfsnapshotgit14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/sfsnapshotgit b/tools/sfsnapshotgit
index e79dd553..8bc19fce 100755
--- a/tools/sfsnapshotgit
+++ b/tools/sfsnapshotgit
@@ -44,11 +44,17 @@ cd "$SFSNAP_REPO"
44# Sometimes "make dist" can modify versioned files so we must reset first 44# Sometimes "make dist" can modify versioned files so we must reset first
45git reset --hard 45git reset --hard
46git clean -qfdx 46git clean -qfdx
47# Any branch used to create snapshots must already exist 47
48# Any branch used to create snapshots must already exist and be properly configured
48git checkout "$HEAD" 49git checkout "$HEAD"
49git fetch "$SFSNAP_ORIGIN" 50
50git reset --hard "$SFSNAP_ORIGIN"/"$HEAD" 51# Get the remote tracking branch from config
51# Tags are important for git-describe 52origin=$(git config branch.$HEAD.remote)
53ref=$(git config branch.$HEAD.merge |sed -e 's|^refs/heads/||')
54git fetch "$origin"
55git reset --hard "$origin/$ref"
56
57# Tags are important for git-describe, but take only the ones from the hard-coded origin
52git fetch --tags "$SFSNAP_ORIGIN" 58git fetch --tags "$SFSNAP_ORIGIN"
53 59
54# Write our snapshot version string (similar to NP-VERSION-GEN) to "release" 60# Write our snapshot version string (similar to NP-VERSION-GEN) to "release"