]> git.ipfire.org Git - thirdparty/git.git/blobdiff - upload-pack.c
short i/o: fix calls to read to use xread or read_in_full
[thirdparty/git.git] / upload-pack.c
index 4a9d6720a5a0e9977bd9346e649666ead4e18fe4..03a4156e19655c1f1d724163d0a712f63fc72c6e 100644 (file)
@@ -1,6 +1,3 @@
-#include <signal.h>
-#include <sys/wait.h>
-#include <sys/poll.h>
 #include "cache.h"
 #include "refs.h"
 #include "pkt-line.h"
@@ -138,6 +135,7 @@ static void create_pack_file(void)
                } else {
                        for (i = 0; i < want_obj.nr; i++) {
                                struct object *o = want_obj.objects[i].item;
+                               /* why??? */
                                o->flags &= ~UNINTERESTING;
                                add_pending_object(&revs, o, NULL);
                        }
@@ -244,7 +242,7 @@ static void create_pack_file(void)
                                        *cp++ = buffered;
                                        outsz++;
                                }
-                               sz = read(pu_pipe[0], cp,
+                               sz = xread(pu_pipe[0], cp,
                                          sizeof(data) - outsz);
                                if (0 < sz)
                                                ;
@@ -269,7 +267,7 @@ static void create_pack_file(void)
                                /* Status ready; we ship that in the side-band
                                 * or dump to the standard error.
                                 */
-                               sz = read(pe_pipe[0], progress,
+                               sz = xread(pe_pipe[0], progress,
                                          sizeof(progress));
                                if (0 < sz)
                                        send_client_data(2, progress, sz);
@@ -564,7 +562,7 @@ static void receive_needs(void)
                        SHALLOW, NOT_SHALLOW);
                while (result) {
                        struct object *object = &result->item->object;
-                       if (!(object->flags & CLIENT_SHALLOW)) {
+                       if (!(object->flags & (CLIENT_SHALLOW|NOT_SHALLOW))) {
                                packet_write(1, "shallow %s",
                                                sha1_to_hex(object->sha1));
                                register_shallow(object->sha1);
@@ -581,6 +579,7 @@ static void receive_needs(void)
                                object->flags &= ~CLIENT_SHALLOW;
                                /* make sure the real parents are parsed */
                                unregister_shallow(object->sha1);
+                               object->parsed = 0;
                                parse_commit((struct commit *)object);
                                parents = ((struct commit *)object)->parents;
                                while (parents) {