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)
committerJun Wang <junbill.wang@samsung.com>
Wed, 27 Jan 2016 17:32:16 +0000 (01:32 +0800)
Change-Id: I3c9b8851490c05719f77a9519418a98f572d68e3
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/git/repository.py

index f52f3f2..fa3ed52 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)