From 7606d1c3e5626ecd9d6ec8fbf76b3a2507251dd7 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 12 Jul 2017 11:33:48 +0200 Subject: [PATCH] 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. --- version-gen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.5