Code

cvsimport: catch error condition where cvs host disappears
authorMartin Langhoff <martin@catalyst.net.nz>
Wed, 2 Nov 2005 00:48:22 +0000 (13:48 +1300)
committerJunio C Hamano <junkio@cox.net>
Wed, 2 Nov 2005 00:57:14 +0000 (16:57 -0800)
Add error handling for cases where the cvs server goes away unexpectedly.
While I don't know why the cvs server is so erratic, we should definitely
exit here before committing bogus files.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsimport.perl

index bbb83fb71cab2d177e98a1c648974bb2bca4607a..e3cad5a1caddf396e2331e4a23f3efc6db5018a7 100755 (executable)
@@ -337,6 +337,10 @@ sub file {
        }
        close ($fh);
 
+       if ($res eq '') {
+           die "Looks like the server has gone away while fetching $fn $rev -- exiting!";
+       }
+
        return ($name, $res);
 }