| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f3be76f commit 7dd8add
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,13 @@ trap 'echo "$0: Check failed. Stopping." >&2' ERR | |||
| 10 | 10 | readonly version_path='VERSION' | |
| 11 | 11 | readonly changes_path='doc/source/changes.rst' | |
| 12 | 12 | ||
| 13 | + function get_latest_tag() { | ||
| 14 | + local config_opts | ||
| 15 | + config_opts="$(printf ' -c versionsort.suffix=-%s' alpha beta pre rc RC)" | ||
| 16 | + # shellcheck disable=SC2086 # Deliberately word-splitting the arguments. | ||
| 17 | + git $config_opts tag -l '[0-9]*' --sort=-v:refname | head -n1 | ||
| 18 | + } | ||
| 19 | + | ||
| 13 | 20 | echo 'Checking current directory.' | |
| 14 | 21 | test "$(cd -- "$(dirname -- "$0")" && pwd)" = "$(pwd)" # Ugly, but portable. | |
| 15 | 22 | ||
@@ -26,8 +33,7 @@ test -z "$(git status -s --ignore-submodules)" | |||
| 26 | 33 | ||
| 27 | 34 | version_version="$(cat "$version_path")" | |
| 28 | 35 | changes_version="$(awk '/^[0-9]/ {print $0; exit}' "$changes_path")" | |
| 29 | - config_opts="$(printf ' -c versionsort.suffix=-%s' alpha beta pre rc RC)" | ||
| 30 | - latest_tag="$(git $config_opts tag -l '[0-9]*' --sort=-v:refname | head -n1)" | ||
| 36 | + latest_tag="$(get_latest_tag)" | ||
| 31 | 37 | head_sha="$(git rev-parse HEAD)" | |
| 32 | 38 | latest_tag_sha="$(git rev-parse "${latest_tag}^{commit}")" | |
| 33 | 39 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments