summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 521003f)
raw | patch | inline | side by side (parent: 521003f)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 23 Aug 2005 05:52:43 +0000 (22:52 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 24 Aug 2005 23:50:53 +0000 (16:50 -0700) |
With this we could say:
Pull: master:ko-master +pu:ko-pu
to mean "fast forward ko-master with master, overwrite ko-pu with pu",
and the latter one does not require the remote "pu" to be descendant
of local "ko-pu".
Signed-off-by: Junio C Hamano <junkio@cox.net>
Pull: master:ko-master +pu:ko-pu
to mean "fast forward ko-master with master, overwrite ko-pu with pu",
and the latter one does not require the remote "pu" to be descendant
of local "ko-pu".
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-fetch-script | patch | blob | history | |
git-parse-remote-script | patch | blob | history |
diff --git a/git-fetch-script b/git-fetch-script
index dc7f4d6e44e9a597a2ed778bc89a3e4693a7fa27..d55cc85620e5952d5172ce1e9128a0168f19b921 100755 (executable)
--- a/git-fetch-script
+++ b/git-fetch-script
;;
esac || {
echo >&2 "* $1: does not fast forward to $4"
- case "$force" in
- t)
+ case "$force,$single_force" in
+ t,* | *,t)
echo >&2 " from $3; forcing update."
;;
*)
# These are relative path from $GIT_DIR, typically starting at refs/
# but may be HEAD
+ if expr "$ref" : '\+' >/dev/null
+ then
+ single_force=t
+ ref=$(expr "$ref" : '\+\(.*\)')
+ else
+ single_force=
+ fi
remote_name=$(expr "$ref" : '\([^:]*\):')
local_name=$(expr "$ref" : '[^:]*:\(.*\)')
while read sha1 remote_name
do
found=
+ single_force=
for ref in $refs
do
case "$ref" in
+ +$remote_name:*)
+ single_force=t
+ found="$ref"
+ break ;;
$remote_name:*)
found="$ref"
break ;;
done
local_name=$(expr "$found" : '[^:]*:\(.*\)')
- append_fetch_head "$sha1" "$remote" "$remote_name" "$remote_nick" "$local_name"
+ append_fetch_head "$sha1" "$remote" "$remote_name" "$remote_nick" "$local_name"
done
;;
esac
index 2da7ae847072ee39a56c4103f4bd3eb5b994f228..cf3788425693750edbb6080a3dfa8b314bf9bdb2 100755 (executable)
--- a/git-parse-remote-script
+++ b/git-parse-remote-script
get_data_source () {
case "$1" in
*/*)
- # Not so fast. This could be the partial URL shorthand...
+ # Not so fast. This could be the partial URL shorthand...
token=$(expr "$1" : '\([^/]*\)/')
remainder=$(expr "$1" : '[^/]*/\(.*\)')
if test -f "$GIT_DIR/branches/$token"
canon_refs_list_for_fetch () {
for ref
do
+ force=
+ case "$ref" in
+ +*)
+ ref=$(expr "$ref" : '\+\(.*\)')
+ force=+
+ ;;
+ esac
expr "$ref" : '.*:' >/dev/null || ref="${ref}:"
remote=$(expr "$ref" : '\([^:]*\):')
local=$(expr "$ref" : '[^:]*:\(.*\)')
'') local= ;;
*) local="refs/heads/$local" ;;
esac
- echo "${remote}:${local}"
+ echo "${force}${remote}:${local}"
done
}
else
case "$ref" in
tag)
- tag_just_seen=yes
+ tag_just_seen=yes
continue
;;
esac
fi
- canon_refs_list_for_fetch "$ref"
+ canon_refs_list_for_fetch "$ref"
done
;;
esac