gitweb: Add author information to commitdiff view
[gitweb.git] / upload-pack.c
index bbd6bd60b52d806be0a69324009755f49b070082..51ce936b060d34a2f759dba4f7aeeecf47a59a4b 100644 (file)
@@ -14,12 +14,12 @@ static const char upload_pack_usage[] = "git-upload-pack [--strict] [--timeout=n
 #define THEY_HAVE (1U << 0)
 #define OUR_REF (1U << 1)
 #define WANTED (1U << 2)
-static int multi_ack = 0, nr_our_refs = 0;
-static int use_thin_pack = 0;
+static int multi_ack, nr_our_refs;
+static int use_thin_pack;
 static struct object_array have_obj;
 static struct object_array want_obj;
-static unsigned int timeout = 0;
-static int use_sideband = 0;
+static unsigned int timeout;
+static int use_sideband;
 
 static void reset_timeout(void)
 {
@@ -374,7 +374,7 @@ static int get_common_commits(void)
                                             sha1_to_hex(sha1),
                                             multi_ack ?  " continue" : "");
                                if (multi_ack)
-                                       memcpy(last_sha1, sha1, 20);
+                                       hashcpy(last_sha1, sha1);
                        }
                        continue;
                }
@@ -459,18 +459,17 @@ static int send_ref(const char *refname, const unsigned char *sha1)
        return 0;
 }
 
-static int upload_pack(void)
+static void upload_pack(void)
 {
        reset_timeout();
        head_ref(send_ref);
        for_each_ref(send_ref);
        packet_flush(1);
        receive_needs();
-       if (!want_obj.nr)
-               return 0;
-       get_common_commits();
-       create_pack_file();
-       return 0;
+       if (want_obj.nr) {
+               get_common_commits();
+               create_pack_file();
+       }
 }
 
 int main(int argc, char **argv)