summaryrefslogtreecommitdiff
path: root/g
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-11-29 10:59:48 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-11-29 11:00:12 -0600
commita7069c2aa24f40b8e47d148b7201f879faa2ff32 (patch)
tree4750f022b756bd7ade20028b2591d36abcc4e32a /g
parent2e76553c7cfbcb08146e1b66129536192df4f2e1 (diff)
git rev-parse argument are not files, no need to try to find abs-path
This was causing some error message on Windows
Diffstat (limited to 'g')
-rwxr-xr-xg19
1 files changed, 12 insertions, 7 deletions
diff --git a/g b/g
index a47f3df0f341..5b39c462ef74 100755
--- a/g
+++ b/g
@@ -220,14 +220,19 @@ while shift ; do
exit 1
}
fi
-
- # make the paths absolute
- FILES[$FILESNUM]=$(perl -e 'use Cwd "abs_path"; print abs_path(shift);' "$PARAM")
- if [ -z "${FILES[$FILESNUM]}" -o ! -e "${FILES[$FILESNUM]}" ] ; then
- # it is probably not a file, but a tag name, or something
+ if [ "$COMMAND" == "rev-parse" ] ; then
+ # this is not a file
FILES[$FILESNUM]="$PARAM"
- fi
- FILESNUM=$(($FILESNUM+1))
+ FILESNUM=$(($FILESNUM+1))
+ else
+ # make the paths absolute
+ FILES[$FILESNUM]=$(perl -e 'use Cwd "abs_path"; print abs_path(shift);' "$PARAM")
+ if [ -z "${FILES[$FILESNUM]}" -o ! -e "${FILES[$FILESNUM]}" ] ; then
+ # it is probably not a file, but a tag name, or something
+ FILES[$FILESNUM]="$PARAM"
+ fi
+ FILESNUM=$(($FILESNUM+1))
+ fi
fi
done