GitRepository/__git_inout: correctly handle input error
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 12 Sep 2014 12:48:20 +0000 (15:48 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 14 Nov 2014 12:47:21 +0000 (14:47 +0200)
Change-Id: I3c9b8851490c05719f77a9519418a98f572d68e3
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/git/repository.py

index 6b21c25..9843d99 100644 (file)
@@ -252,7 +252,12 @@ class GitRepository(object):
             ready = select.select(out_fds, in_fds, [])
             # Write in chunks of 512 bytes
             if ready[1]:
-                popen.stdin.write(stdin[w_ind:w_ind+512])
+                try:
+                    popen.stdin.write(stdin[w_ind:w_ind+512])
+                except IOError:
+                    # Ignore, we want to read buffers to e.g. get error message
+                    # Git should give an error code so that we catch an error
+                    pass
                 w_ind += 512
                 if w_ind > len(stdin):
                     rm_polled_fd(popen.stdin, in_fds)