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:
authorJunio C Hamano <junkio@cox.net>2005-07-16 11:16:24 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-16 20:23:06 +0400
commitf170e4b39d87365cda17b80436ba6db4a2044e88 (patch)
treedb95f53ae73c341922700257c15443080e176054 /git-pull-script
parent02d57da4a5c238eff7ea115c69d2e5c977bf1adb (diff)
[PATCH] fetch/pull: short-hand notation for remote repositories.
Since pull and fetch are done often against the same remote repository repeatedly, keeping the URL to pull from along with the name of the head to use in $GIT_DIR/branches/$name makes a lot of sense. Adopt that convention from Cogito, and try to be compatible when possible; storing a partial URL and completing it with a trailing path may not be understood by Cogito. While we are at it, fix pulling a tag. Earlier, we updated only refs/tags/$tag without updating FETCH_HEAD, and called resolve-script using a stale (or absent) FETCH_HEAD. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'git-pull-script')
-rwxr-xr-xgit-pull-script19
1 files changed, 3 insertions, 16 deletions
diff --git a/git-pull-script b/git-pull-script
index 8e309fc98b..fc463260bd 100755
--- a/git-pull-script
+++ b/git-pull-script
@@ -1,23 +1,10 @@
#!/bin/sh
#
. git-sh-setup-script || die "Not a git archive"
+. git-parse-remote "$@"
+merge_name="$_remote_name"
-merge_repo=$1
-
-merge_name=$(echo "$1" | sed 's:\.git/*$::')
-merge_head=HEAD
-type=head
-if [ "$2" = "tag" ]; then
- type=tag
- shift
-fi
-if [ "$2" ]
-then
- merge_name="$type '$2' of $merge_name"
- merge_head="refs/${type}s/$2"
-fi
-
-git-fetch-script "$merge_repo" "$merge_head" || exit 1
+git-fetch-script "$@" || exit 1
git-resolve-script \
"$(cat "$GIT_DIR"/HEAD)" \