Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion base/version_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ if [ -n "$(git status --porcelain)" ]; then
# append dirty mark '*' if the repository has uncommitted changes
commit_short="$commit_short"*
fi
branch=$(git rev-parse --abbrev-ref HEAD)

# Our CI system checks commits out as a detached head, and so we must
# use the provided branch name, as we cannot autodetect this commit as
# the tip of any such branch.
if [ -n "${BUILDKITE_BRANCH}" ]; then
branch="${BUILDKITE_BRANCH}"
else
branch=$(git rev-parse --abbrev-ref HEAD)
fi

topdir=$(git rev-parse --show-toplevel)
verchanged=$(git blame -L ,1 -sl -- "$topdir/VERSION" | cut -f 1 -d " ")
Expand Down