Merge branch 'np/verbose-push'
[gitweb.git] / builtin-upload-archive.c
index 115a12dc13a09e9bfd4c965ca632709e0f1cd89b..45c92e163c477af4ec7c36c8ee6fcfd9242a0b2d 100644 (file)
@@ -2,13 +2,13 @@
  * Copyright (c) 2006 Franck Bui-Huu
  */
 #include <time.h>
+#include <sys/wait.h>
+#include <sys/poll.h>
 #include "cache.h"
 #include "builtin.h"
 #include "archive.h"
 #include "pkt-line.h"
 #include "sideband.h"
-#include <sys/wait.h>
-#include <sys/poll.h>
 
 static const char upload_archive_usage[] =
        "git-upload-archive <repo>";
@@ -160,7 +160,8 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
                if (pfd[1].revents & POLLIN)
                        /* Status stream ready */
                        process_input(pfd[1].fd, 2);
-               if ((pfd[0].revents | pfd[1].revents) == POLLIN)
+               /* Always finish to read data when available */
+               if ((pfd[0].revents | pfd[1].revents) & POLLIN)
                        continue;
 
                if (waitpid(writer, &status, 0) < 0)