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-08-23 09:52:43 +0400
committerJunio C Hamano <junkio@cox.net>2005-08-25 03:50:53 +0400
commitefe9bf0f3b34d12b3b76f8277550f91700609b25 (patch)
tree50ecb933fd3117f7360eb7c5e9c481359d0f5abe /git-parse-remote-script
parent521003ff52d1cf742350e1342bc2dd4ab1b51e6b (diff)
[PATCH] Allow "+remote:local" refspec to cause --force when fetching.
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>
Diffstat (limited to 'git-parse-remote-script')
-rwxr-xr-xgit-parse-remote-script15
1 files changed, 11 insertions, 4 deletions
diff --git a/git-parse-remote-script b/git-parse-remote-script
index 2da7ae8470..cf37884256 100755
--- a/git-parse-remote-script
+++ b/git-parse-remote-script
@@ -5,7 +5,7 @@
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"
@@ -69,6 +69,13 @@ get_remote_default_refs_for_push () {
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" : '[^:]*:\(.*\)')
@@ -80,7 +87,7 @@ canon_refs_list_for_fetch () {
'') local= ;;
*) local="refs/heads/$local" ;;
esac
- echo "${remote}:${local}"
+ echo "${force}${remote}:${local}"
done
}
@@ -132,12 +139,12 @@ get_remote_refs_for_fetch () {
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