0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-01 09:35:52 -05:00
bitcoin-bitcoin-core/contrib/shell/git-utils.bash
2021-04-05 11:00:21 -04:00

14 lines
287 B
Bash

#!/usr/bin/env bash
git_root() {
git rev-parse --show-toplevel 2> /dev/null
}
git_head_version() {
local recent_tag
if recent_tag="$(git describe --exact-match HEAD 2> /dev/null)"; then
echo "${recent_tag#v}"
else
git rev-parse --short=12 HEAD
fi
}