From: Andre Noll <maan@tuebingen.mpg.de>
Date: Wed, 12 Jul 2017 09:33:48 +0000 (+0200)
Subject: version-gen.sh: Make it work in conflicted state.
X-Git-Tag: v1.0.1~4
X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=7606d1c3e5626ecd9d6ec8fbf76b3a2507251dd7;p=lopsub.git

version-gen.sh: Make it work in conflicted state.

If the working tree contains unmerged paths, git update-index -q
prints a "file: needs merge" message to stdout. This message confuses
the build system which runs this git command via version-gen.sh and
expects it to output a git version string.

This commit redirects stdout of the git command to /dev/null to make
sure that version-gen.sh outputs only the version string.
---

diff --git a/version-gen.sh b/version-gen.sh
index ed3a22e..b20e4c8 100755
--- a/version-gen.sh
+++ b/version-gen.sh
@@ -7,7 +7,7 @@ if [ -e '.git' -o -e '../.git' ]; then
 	git_ver=$(git describe --abbrev=4 HEAD 2>/dev/null)
 	[ -z "$git_ver" ] && git_ver="$ver"
 	# update stat information in index to match working tree
-	git update-index -q --refresh
+	git update-index -q --refresh > /dev/null
 	# if there are differences (exit code 1), the working tree is dirty
 	git diff-index --quiet HEAD || git_ver=$git_ver-dirty
 	ver=$git_ver