]> Nutra Git (v2) - gamesguru/git-remote-gcrypt.git/commitdiff
fix on OSX
authorJoey Hess <joey@kitenet.net>
Mon, 19 May 2014 22:20:51 +0000 (18:20 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 19 May 2014 22:20:51 +0000 (18:20 -0400)
set -e causes the xecho to not run if the xgrep fails. At least with OSX's
/bin/sh, which is:

GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)

This didn't happen on Linux with:

GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)

Possibly a bug in bash, or an OSX-specific bug. However, disabling set -e
in the subshell seems a good idea anyway.

fixes https://github.com/blake2-ppc/git-remote-gcrypt/issues/15

git-remote-gcrypt

index 8c1efa6e33fac2b25768bb482276ed7f130c3c13..22951114a02969a728db6a72cd0cbb2bca9cefaf 100755 (executable)
@@ -176,8 +176,10 @@ update_tree()
 {
        local tab_="    "
        # $2 is a filename from the repo format
-       (git ls-tree "$1" | xgrep -v -E '\b'"$2"'$';
-               xecho "100644 blob $3$tab_$2") | git mktree
+       (set +e;
+               git ls-tree "$1" | xgrep -v -E '\b'"$2"'$';
+               xecho "100644 blob $3$tab_$2"
+       ) | git mktree
 }
 
 # Put giturl $1, file $2