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.
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