aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSebastian Reuße <seb@wirrsal.net>2015-12-27 11:27:38 +0100
committerSean Whitton <spwhitton@spwhitton.name>2016-07-04 17:47:26 +0900
commit6aa32c20e1fb6c9aad5e071fca84e52a06ef4991 (patch)
treeca658fce3e2e740362187a9310d9a5147995dd7f
parente2c5546b5d0290dbeba7018bd21ff2931ae8310a (diff)
downloadgit-remote-gcrypt-6aa32c20e1fb6c9aad5e071fca84e52a06ef4991.tar.gz
Fix #20.
When a gcrypt remote is not available, for any reason (network being down, the drive containing it not being mounted, etc), pushing to the remote causes a new repository ID to be created. Instead, we now fail loudly when a remote is unavailable and when the remote ID is already set. https://github.com/bluss/git-remote-gcrypt/issues/20 (cherry picked from commit b46d48af15e0f8b89f2666aff2c045c9306305d6)
-rwxr-xr-xgit-remote-gcrypt7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index bba6a22..c9c4102 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -507,7 +507,12 @@ ensure_connected()
tmp_manifest="$Tempdir/maniF"
GET "$URL" "$Manifestfile" "$tmp_manifest" 2>/dev/null || {
echo_info "Repository not found: $URL"
- return 0
+ if ! isnull "$Repoid"; then
+ echo_info "..but repository ID is set. Aborting."
+ return 1
+ else
+ return 0
+ fi
}
Did_find_repo=yes