Write invalid data when cloning to force an abort
authorAlex Crichton <alex@alexcrichton.com>
Sun, 24 Dec 2017 03:45:37 +0000 (19:45 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 24 Dec 2017 03:46:34 +0000 (19:46 -0800)
Otherwise it seems libgit2 isn't ready to handle premature eof? Unclear...

tests/git.rs

index 33ffe8c168dbf04c54926ffaf9830983cccfd540..ce2836a7843e994af51f1dbc0bb7b6ef506143a9 100644 (file)
@@ -2205,7 +2205,9 @@ fn failed_submodule_checkout() {
 
     let t = thread::spawn(move || {
         while !done2.load(Ordering::SeqCst) {
-            drop(listener.accept());
+            if let Ok((mut socket, _)) = listener.accept() {
+                drop(socket.write_all(b"foo\r\n"));
+            }
         }
     });