diff options
author | root <root@localhost> | 2013-02-14 00:00:00 +0000 |
---|---|---|
committer | root <root@localhost> | 2013-02-14 00:00:00 +0000 |
commit | 64eb50b695cbd71761e12c50c6362393532d54e2 (patch) | |
tree | 9428464865c557bcc4b4b14bfdf395c98c00fd4f | |
parent | 789cb4d7c3809d74820741244dc4e054589af1df (diff) | |
download | git-remote-gcrypt-64eb50b695cbd71761e12c50c6362393532d54e2.zip git-remote-gcrypt-64eb50b695cbd71761e12c50c6362393532d54e2.tar.gz git-remote-gcrypt-64eb50b695cbd71761e12c50c6362393532d54e2.tar.bz2 |
Automatically forward-port repository config
Change remote configurations when encountered:
* gcrypt::ssh -> gcrypt::rsync
* repo/G.XXXX -> #XXX
* gitception:// -> ""
-rwxr-xr-x | git-remote-gcrypt | 22 |
1 files changed, 22 insertions, 0 deletions
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 |