]> Nutra Git (v1) - gamesguru/git-remote-gcrypt.git/commitdiff
Fix quoting of '$' for grep
authorroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
committerroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
git-remote-gcrypt

index 2a47b67fdc630d10382b4db1bfca2572e566eeb4..32071fd07d3dbda0172279eaeb16e8bd65b31f4f 100755 (executable)
@@ -36,7 +36,7 @@ gitception_get()
        [ -e "$FHEAD" ] && command mv -f "$FHEAD" "$FHEAD.$$~" || :
        git fetch -q -f "$1" HEAD:"$GREF" 2>/dev/tty >/dev/null &&
                OBJID="$(git ls-tree "$GREF" |
-                       xgrep -E "\b$2$" | awk '{print $3}')" &&
+                       xgrep -E '\b'"$2"'$' | awk '{print $3}')" &&
                [ -n "$OBJID" ] && git cat-file blob "$OBJID" && RETVAL=: ||
                { RETVAL=false && : ; }
        [ -e "$FHEAD.$$~" ] && command mv -f "$FHEAD.$$~" "$FHEAD" || :
@@ -56,7 +56,7 @@ anon_commit()
 update_tree()
 {
        # $2 is a filename from the repo format
-       (git ls-tree "$1" | xgrep -v -E "\b$2$";
+       (git ls-tree "$1" | xgrep -v -E '\b'"$2"'$';
                printf "100644 blob %s\t%s" "$3" "$2") | git mktree
 }