From b86f0a024393cee93d997f61c044edbbfafc53d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Date: Sun, 27 Dec 2015 11:27:38 +0100 Subject: 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) --- git-remote-gcrypt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/git-remote-gcrypt b/git-remote-gcrypt index 8d68669..9ca9552 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -505,7 +505,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 -- cgit v1.1