summaryrefslogtreecommitdiff
path: root/git-fetch.sh
diff options
context:
space:
mode:
authorSanti Béjar <sbejar@gmail.com>2006-09-23 10:05:43 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-09-24 07:13:49 (GMT)
commit648ad18f5077295c4317f0784b29e09d2c0bac93 (patch)
tree9b6315db16fd1be76e63e19af193a8939f2b7434 /git-fetch.sh
parented1795fcc5f2aa3f105630429bcbed49c50053fa (diff)
downloadgit-648ad18f5077295c4317f0784b29e09d2c0bac93.zip
git-648ad18f5077295c4317f0784b29e09d2c0bac93.tar.gz
git-648ad18f5077295c4317f0784b29e09d2c0bac93.tar.bz2
Fetch: default remote repository from branch properties
If in branch "foo" and this in config: [branch "foo"] remote=bar "git fetch" = "git fetch bar" "git pull" = "git pull bar" Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-fetch.sh')
-rwxr-xr-xgit-fetch.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/git-fetch.sh b/git-fetch.sh
index 09a5d6c..50ad101 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -68,11 +68,10 @@ done
case "$#" in
0)
- test -f "$GIT_DIR/branches/origin" ||
- test -f "$GIT_DIR/remotes/origin" ||
- git-repo-config --get remote.origin.url >/dev/null ||
- die "Where do you want to fetch from today?"
- set origin ;;
+ origin=$(get_default_remote)
+ test -n "$(get_remote_url ${origin})" ||
+ die "Where do you want to fetch from today?"
+ set x $origin ; shift ;;
esac
remote_nick="$1"