]> Nutra Git (v1) - gamesguru/git-remote-gcrypt.git/commitdiff
Fix #20.
authorSebastian Reuße <seb@wirrsal.net>
Sun, 27 Dec 2015 10:27:38 +0000 (11:27 +0100)
committerSean Whitton <spwhitton@spwhitton.name>
Mon, 4 Jul 2016 08:47:26 +0000 (17:47 +0900)
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

index bba6a222173909d84d0793ff77de7ba3f90a8a8a..c9c4102c00ef59d0ca16f98e89352ad58e2283cc 100755 (executable)
@@ -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