aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@localhost>2013-02-14 00:00:00 +0000
committerroot <root@localhost>2013-02-14 00:00:00 +0000
commit6173d0ffe0c93d0ff962e6ad12d9d170c7a6bb01 (patch)
tree25a3b64b21c5d7ebad5e36d45d3610e746a37846
parent192befdb62bed177fc81db2f14246294e6ad9e0c (diff)
downloadgit-remote-gcrypt-6173d0ffe0c93d0ff962e6ad12d9d170c7a6bb01.zip
git-remote-gcrypt-6173d0ffe0c93d0ff962e6ad12d9d170c7a6bb01.tar.gz
git-remote-gcrypt-6173d0ffe0c93d0ff962e6ad12d9d170c7a6bb01.tar.bz2
Use URL fragment for repository id instead of G.*
-rw-r--r--README.rst2
-rwxr-xr-xgit-remote-gcrypt18
2 files changed, 11 insertions, 9 deletions
diff --git a/README.rst b/README.rst
index ffd5a81..828c834 100644
--- a/README.rst
+++ b/README.rst
@@ -44,7 +44,7 @@ Create an encrypted remote by pushing to it:
git push cryptremote master
> gcrypt: Setting up new repository at ssh://example.com:repo
> gcrypt: Repository ID is KNBr0wKzct52
- > gcrypt: Repository URL is gcrypt::ssh://example.com:repo/G.KNBr0wKzct52
+ > gcrypt: Repository URL is gcrypt::ssh://example.com:repo#KNBr0wKzct52
> gcrypt: (configuration for cryptremote updated)
> [ more lines .. ]
> To gcrypt::[...]
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index 3fdb932..cc92378 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -16,7 +16,6 @@ Gref="refs/gcrypt/gitception$GITCEPTION"
Gref_rbranch="refs/heads/master"
Repoid=
Hashpfx=":SHA224:"
-UrlTag="G."
Packpfx="pack $Hashpfx"
Packkey_bytes=33
@@ -304,10 +303,10 @@ make_new_repo()
Repoid=$(xecho_n "$urlid_" | pack_hash)
echo_info "Repository ID is" "$urlid_"
iseq "${NAME#gcrypt::}" "$URL" || {
- git config "remote.$NAME.url" "gcrypt::$URL/$UrlTag$urlid_"
+ git config "remote.$NAME.url" "gcrypt::$URL#$urlid_"
fix_config=1
}
- echo_info "Repository URL is" "gcrypt::$URL/$UrlTag$urlid_"
+ echo_info "Repository URL is" "gcrypt::$URL#$urlid_"
Extension_list=$(xecho "extn comment")
isnull "$fix_config" || echo_info "(configuration for $NAME updated)"
}
@@ -330,11 +329,14 @@ ensure_connected()
Did_find_repo=no
read_config
- # split out Repoid from URL
- url_id=${URL##*/"$UrlTag"}
- isnoteq "$url_id" "$URL" || return 0
-
- URL=${URL%/"$UrlTag$url_id"}
+ # split out Repo ID from URL
+ url_id=${URL##*"#"}
+ isnoteq "$url_id" "$URL" || {
+ url_id=${URL##*/"G."}
+ isnoteq "$url_id" "$URL" || return 0
+ URL=${URL%/"G.$url_id"}
+ }
+ URL=${URL%"#$url_id"}
Repoid=$(xecho_n "$url_id" | pack_hash)
TmpManifest_Enc="$Localdir/manifest.$$"