Make sure that --read-batch doesn't try to check args.
[rsync.git] / mkgitver
1 #!/bin/sh
2
3 srcdir=`dirname $0`
4 gitver=`git describe --abbrev=8 2>/dev/null`
5
6 if [ ! -f git-version.h ]; then
7     touch git-version.h
8 fi
9
10 case "$gitver" in
11     *.*)
12         echo "#define RSYNC_GITVER \"$gitver\"" >git-version.h.new
13         if ! diff git-version.h.new git-version.h >/dev/null; then
14             echo "Updating git-version.h"
15             mv git-version.h.new git-version.h
16         else
17             rm git-version.h.new
18         fi
19         ;;
20 esac