1
0
mirror of https://github.com/git/git.git synced 2024-11-16 02:13:11 +01:00
git/git-pull-script
Junio C Hamano f170e4b39d [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>
2005-07-16 09:23:06 -07:00

13 lines
250 B
Bash
Executable File

#!/bin/sh
#
. git-sh-setup-script || die "Not a git archive"
. git-parse-remote "$@"
merge_name="$_remote_name"
git-fetch-script "$@" || exit 1
git-resolve-script \
"$(cat "$GIT_DIR"/HEAD)" \
"$(cat "$GIT_DIR"/FETCH_HEAD)" \
"Merge $merge_name"