From 648ad18f5077295c4317f0784b29e09d2c0bac93 Mon Sep 17 00:00:00 2001 From: Santi Béjar Date: Sat, 23 Sep 2006 12:05:43 +0200 Subject: Fetch: default remote repository from branch properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- git-fetch.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'git-fetch.sh') diff --git a/git-fetch.sh b/git-fetch.sh index 09a5d6ceab..50ad101e89 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" -- cgit 1.2.3-korg