]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
use ls-files instead of rev-parse
authorRudolf Polzer <divVerent@xonotic.org>
Fri, 27 May 2011 10:31:11 +0000 (12:31 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Fri, 27 May 2011 10:31:11 +0000 (12:31 +0200)
misc/tools/cached-converter.sh

index 2bcaacb2373d153533679e3cb4a98f07e979060e..f914efa308dadde162582be69dbcce3c9d9a2d78 100755 (executable)
@@ -58,9 +58,9 @@ cached()
                        esac
                done
                if [ -n "$git_src_repo" ] && ! $evil; then
-                       sum=`( cd "$git_src_repo"; git rev-parse --revs-only HEAD:"${infile1#./}" | grep . ) || { echo >&2 "git-rev-parse failed on $infile1"; git hash-object "$infile1"; }`
+                       sum=`( cd "$git_src_repo"; git ls-files -s "${infile1#./}" | cut -d ' ' -f 2 | grep . ) || { echo >&2 "git-ls-files failed on $infile1"; git hash-object "$infile1"; }`
                        if [ -n "$infile2" ]; then
-                               sum=$sum`( cd "$git_src_repo"; git rev-parse --revs-only HEAD:"${infile2#./}" | grep . ) || { echo >&2 "git-rev-parse failed on $infile2"; git hash-object "$infile2"; }`
+                               sum=$sum`( cd "$git_src_repo"; git ls-files -s "${infile2#./}" | cut -d ' ' -f 2 | grep . ) || { echo >&2 "git-ls-files failed on $infile2"; git hash-object "$infile2"; }`
                        fi
                else
                        sum=`git hash-object "$infile1"`