From patchwork Thu Jan 24 13:11:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 10778947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D2AC91E for ; Thu, 24 Jan 2019 13:11:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC2532F461 for ; Thu, 24 Jan 2019 13:11:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9D362F487; Thu, 24 Jan 2019 13:11:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 946F72F461 for ; Thu, 24 Jan 2019 13:11:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbfAXNLy (ORCPT ); Thu, 24 Jan 2019 08:11:54 -0500 Received: from cloud.peff.net ([104.130.231.41]:47190 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726105AbfAXNLx (ORCPT ); Thu, 24 Jan 2019 08:11:53 -0500 Received: (qmail 27437 invoked by uid 109); 24 Jan 2019 13:11:53 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Thu, 24 Jan 2019 13:11:53 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 28264 invoked by uid 111); 24 Jan 2019 13:11:58 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) SMTP; Thu, 24 Jan 2019 08:11:58 -0500 Authentication-Results: peff.net; auth=none Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Thu, 24 Jan 2019 08:11:51 -0500 Date: Thu, 24 Jan 2019 08:11:51 -0500 From: Jeff King To: git@vger.kernel.org Subject: [PATCH 3/8] create_bundle(): drop unused "header" parameter Message-ID: <20190124131151.GC22398@sigill.intra.peff.net> References: <20190124131104.GA24017@sigill.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190124131104.GA24017@sigill.intra.peff.net> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- builtin/bundle.c | 3 +-- bundle.c | 4 ++-- bundle.h | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/builtin/bundle.c b/builtin/bundle.c index 9e9c65d9c6..1ea4bfdfc1 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -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.")); diff --git a/bundle.c b/bundle.c index 37b1daa691..b45666c49b 100644 --- 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; diff --git a/bundle.h b/bundle.h index 781e6f5c3a..37c37d7f65 100644 --- 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,