diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2022-07-10 14:58:40 +0200 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2022-07-28 12:56:28 -0700 |
commit | 135fb67e224f9b2397eafdd02e86a409b7a4642c (patch) | |
tree | 75e223cfe8d7060c3d6db12015fe53e934717266 | |
parent | 607efef70b0cbc1dca72487e4d7d5e01e10582d7 (diff) |
version.sh: fix robustness on git failure
for instance, with untrusted directory under sudo.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
-rw-r--r-- | version.sh | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -15,7 +15,9 @@ version=`echo $latesttag | sed -e s/mutt-// -e s/-rel// -e s/-/./g` distance=`git rev-list --count $latesttag..` commitid=`git rev-parse --short HEAD` -if [ $distance -eq 0 ]; then +[ x = "x$distance" ] && exec cat VERSION + +if [ 0 -eq "$distance" ]; then distance= else distance="+$distance" |