Skip to contentSkip to conversation

cvsimport: catch error condition where cvs host disappears

PATCH New Martin Langhoff 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cvsimport: catch error condition where cvs host disappears

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.

---

 git-cvsimport.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

applies-to: 5184f41aebc18fdd90c27b76b8fb230fda58fb84 2f441d6598e78b59181a084f9db5be7993971602

git-cvsimport.perl +4 -0
index bbb83fb..e3cad5a 100755
@@ -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);
 }
 

---
0.99.8.GIT