Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanti Béjar <sbejar@gmail.com>2006-09-23 14:05:43 +0400
committerJunio C Hamano <junkio@cox.net>2006-09-24 11:13:49 +0400
commit648ad18f5077295c4317f0784b29e09d2c0bac93 (patch)
tree9b6315db16fd1be76e63e19af193a8939f2b7434 /git-parse-remote.sh
parented1795fcc5f2aa3f105630429bcbed49c50053fa (diff)
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-parse-remote.sh')
-rwxr-xr-xgit-parse-remote.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 187f0883c9..69998169b7 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