From 8045e57b81615a94a07503bd68045f6fd0ceabe9 Mon Sep 17 00:00:00 2001 From: gardners Date: Fri, 26 Apr 2013 15:27:53 +0930 Subject: [PATCH] fixed version_string.sh to work (or at least not fail) with git 1.7.3. --- version_string.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version_string.sh b/version_string.sh index 9ecba3bd..4b8a96e9 100755 --- a/version_string.sh +++ b/version_string.sh @@ -42,7 +42,7 @@ fi if ! git describe "${dirty:+--dirty=$dirty}" 2>/dev/null; then original_commit=$(git rev-list --reverse --max-parents=0 --abbrev-commit HEAD 2>/dev/null | head -n 1) - if [ -n "$original_commit" ]; then + if [ -z "$original_commit" ]; then original_commit=$(git rev-list --reverse --abbrev-commit HEAD | head -n 1) fi if [ -z "$original_commit" ]; then @@ -50,7 +50,7 @@ if ! git describe "${dirty:+--dirty=$dirty}" 2>/dev/null; then exit 1 fi existing_start_tag="$(git rev-list --no-walk START 2>/dev/null | true)" - if [ -n "$(git tag --list START)" -a "$existing_start_tag" != "$original_commit" ]; then + if [ -n "$(git tag --list START 2>/dev/null)" -a "$existing_start_tag" != "$original_commit" ]; then echo "$0: tag 'START' is already in use" >&2 exit 1 fi