Skip to content

Commit ec53b0d

Browse files
committed
release.sh: make the list of tags reproducible
When doing git-clone to a subdir, do not keep tags, since there can be local tags affecting `git describe` and buildvcs info. Instead pull the tags from upstream.
1 parent a889fbe commit ec53b0d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

release.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,19 @@ fi
157157
green " - Cloning to subdir ${BUILD_DIR} to get clean Git"
158158
mkdir -p "$BUILD_DIR"
159159
cd "$BUILD_DIR"
160-
git clone --tags "$SCRIPT_DIR" .
160+
git clone --no-tags "$SCRIPT_DIR" .
161+
162+
# It is cloned without tags from the local dir and tags are pulled later
163+
# from the upstream to make sure we have the same set of tags. Otherwise
164+
# we can endup with different `git describe` and buildvcs info depending
165+
# on local tags.
166+
green " - Pulling tags from upstream"
167+
git pull --tags https://github.com/lightninglabs/loop
168+
169+
# The cloned Git repo may be on wrong branch and commit.
170+
commit=$(git --git-dir "${SCRIPT_DIR}/.git" rev-parse HEAD)
171+
green " - Checkout commit ${commit} in ${BUILD_DIR}"
172+
git checkout -b build-branch "$commit"
161173

162174
green " - Checking tag $1"
163175
check_tag $1

0 commit comments

Comments
 (0)