git-fetch: make it work from within a subdirectory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Dec 14, 2006 at 00:36 UTC
4da9028578ffaaf8985e1436e2e1cf16bd3b9023
1 file changed
+6
git-fetch.sh
+6
@@ -2,7 +2,13 @@
2
#
3
4
USAGE='<fetch-options> <repository> <refspec>...'
5
+SUBDIRECTORY_OK=Yes
6
. git-sh-setup
7
+TOP=$(git-rev-parse --show-cdup)
8
+if test ! -z "$TOP"
9
+then
10
+ cd "$TOP"
11
+fi
12
. git-parse-remote
13
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
14
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"