From 64eb50b695cbd71761e12c50c6362393532d54e2 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 14 Feb 2013 00:00:00 +0000 Subject: Automatically forward-port repository config Change remote configurations when encountered: * gcrypt::ssh -> gcrypt::rsync * repo/G.XXXX -> #XXX * gitception:// -> "" --- git-remote-gcrypt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'git-remote-gcrypt') diff --git a/git-remote-gcrypt b/git-remote-gcrypt index 93665dd..b96889f 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -389,11 +389,33 @@ ensure_connected() # Fixup ssh:// -> rsync:// if isurl ssh "$URL"; then URL="rsync://${URL#ssh://}" + isnull "$r_name" || { + git config "remote.$r_name.url" "gcrypt::$URL" + echo_info "Updated URL for $r_name, ssh: -> rsync:" + } + fi + if isurl gitception "$URL" && isnonnull "$r_name"; then + git config "remote.$r_name.url" "gcrypt::${URL#gitception://}" + echo_info "Updated URL for $r_name, gitception:// -> ()" fi # Find the URL fragment Urlfrag=${URL##*"#"} isnoteq "$Urlfrag" "$URL" || Urlfrag= + isnonnull "$Urlfrag" || { + # find old style /G.XXXXXX fragment + Urlfrag=${URL##*/G.} + if isnoteq "$Urlfrag" "$URL"; then + URL=${URL%/G."$Urlfrag"} + isnull "$r_name" || { + git config "remote.$r_name.url" \ + "gcrypt::$URL#$Urlfrag" + echo_info "Updated URL for $r_name, use #fragment" + } + else + Urlfrag= + fi + } URL=${URL%"#$Urlfrag"} # manifestfile -- sha224 hash if we can, else the default location -- cgit v1.2.3