From 648ad18f5077295c4317f0784b29e09d2c0bac93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santi=20B=C3=A9jar?= 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-parse-remote.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'git-parse-remote.sh') diff --git a/git-parse-remote.sh b/git-parse-remote.sh index 187f0883c..69998169b 100755 --- a/git-parse-remote.sh +++ b/git-parse-remote.sh @@ -68,6 +68,12 @@ get_remote_url () { esac } +get_default_remote () { + curr_branch=$(git-symbolic-ref HEAD | sed -e 's|^refs/heads/||') + origin=$(git-repo-config --get "branch.$curr_branch.remote") + echo ${origin:-origin} +} + get_remote_default_refs_for_push () { data_source=$(get_data_source "$1") case "$data_source" in -- cgit v1.2.1