create_bundle(): drop unused "header" parameter
authorJeff King <peff@peff.net>
Thu, 24 Jan 2019 13:11:51 +0000 (08:11 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Jan 2019 20:35:44 +0000 (12:35 -0800)
There's no need to pass a header struct to create_bundle(); it writes
the header information directly to a descriptor (and does not report
back details to the caller).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/bundle.c
bundle.c
bundle.h
index 9e9c65d9c698cae2ab735463edf378d5dd3a9815..1ea4bfdfc19868d9cb89bb7014c138f145f7dd67 100644 (file)
@@ -56,8 +56,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
                }
                if (!startup_info->have_repository)
                        die(_("Need a repository to create a bundle."));
-               return !!create_bundle(the_repository, &header,
-                                      bundle_file, argc, argv);
+               return !!create_bundle(the_repository, bundle_file, argc, argv);
        } else if (!strcmp(cmd, "unbundle")) {
                if (!startup_info->have_repository)
                        die(_("Need a repository to unbundle."));
index 37b1daa6918bafb6b21faba47d25fcc6433698ba..b45666c49b1c19a63d816527a761d0177d9633ce 100644 (file)
--- a/bundle.c
+++ b/bundle.c
@@ -424,8 +424,8 @@ static int write_bundle_refs(int bundle_fd, struct rev_info *revs)
        return ref_count;
 }
 
-int create_bundle(struct repository *r, struct bundle_header *header,
-                 const char *path, int argc, const char **argv)
+int create_bundle(struct repository *r, const char *path,
+                 int argc, const char **argv)
 {
        struct lock_file lock = LOCK_INIT;
        int bundle_fd = -1;
index 781e6f5c3a837ac65e6911ec5e0ae458b8b6a5c7..37c37d7f653c68ab6752fab8203b59783e2f5c40 100644 (file)
--- a/bundle.h
+++ b/bundle.h
@@ -18,8 +18,8 @@ struct bundle_header {
 
 int is_bundle(const char *path, int quiet);
 int read_bundle_header(const char *path, struct bundle_header *header);
-int create_bundle(struct repository *r, struct bundle_header *header,
-                 const char *path, int argc, const char **argv);
+int create_bundle(struct repository *r, const char *path,
+                 int argc, const char **argv);
 int verify_bundle(struct repository *r, struct bundle_header *header, int verbose);
 #define BUNDLE_VERBOSE 1
 int unbundle(struct repository *r, struct bundle_header *header,