summaryrefslogtreecommitdiff
path: root/git-fetch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-14 00:36:23 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-14 02:45:51 -0800
commit4da9028578ffaaf8985e1436e2e1cf16bd3b9023 (patch)
tree332a967879eda2e493a26f012d9a2fa52777f60f /git-fetch.sh
parent02c9e93547d4c21635beb30895ebb6e37f67833c (diff)
downloadgit-4da9028578ffaaf8985e1436e2e1cf16bd3b9023.tar.gz
git-fetch: make it work from within a subdirectory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-fetch.sh')
-rwxr-xr-xgit-fetch.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-fetch.sh b/git-fetch.sh
index 4eecf148ea..fb35815a5f 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -2,7 +2,13 @@
#
USAGE='<fetch-options> <repository> <refspec>...'
+SUBDIRECTORY_OK=Yes
. git-sh-setup
+TOP=$(git-rev-parse --show-cdup)
+if test ! -z "$TOP"
+then
+ cd "$TOP"
+fi
. git-parse-remote
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"