version-gen.sh: Make it work in conflicted state.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 12 Jul 2017 09:33:48 +0000 (11:33 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 28 Nov 2017 09:54:24 +0000 (10:54 +0100)
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.

version-gen.sh

index ed3a22e6bc339b31f494f2a8afe97905eff5faa6..b20e4c8fe9fe7c15d3bb47f124f00a801cedf2e8 100755 (executable)
@@ -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