From patchwork Mon Oct 8 15:17:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Passaro via GitGitGadget X-Patchwork-Id: 10630955 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 01CB415E8 for ; Mon, 8 Oct 2018 15:17:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7C0A212D5 for ; Mon, 8 Oct 2018 15:17:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC27728F71; Mon, 8 Oct 2018 15:17:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 89AA6212D5 for ; Mon, 8 Oct 2018 15:17:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbeJHW3R (ORCPT ); Mon, 8 Oct 2018 18:29:17 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44165 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbeJHW3R (ORCPT ); Mon, 8 Oct 2018 18:29:17 -0400 Received: by mail-pf1-f194.google.com with SMTP id r9-v6so8368029pff.11 for ; Mon, 08 Oct 2018 08:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=KP51qsoDsnzDw8hwyR/tzMp85bgwLf40on24ZTmcMNw=; b=CvEEF9art3sdbvipTGb4KL+TS5zysfg7pcKeQFgLE9t0W09T5+K0g4FpA1taE+YQak OqPlnmiHy3qj7j71h/ao4KK+3lkAWTYj/B4S/c12MEbhtF+k3lwxEu7tsaseyJdjNSyS y0Y1Ggz3oZgEJ/ZSaYQ84JpS7ukRfMNhnUZOM3VfNfPw7JJKakuZiLmVUbG5HkGpUqdY ZU1oxZIitYcCimYR6ZBwRKwR6kC7rTZqVkHZmdPUqtDE+7981oLOUP6iFU/5Yv4Zat05 vZXK+bghKwE7xbwbujN7MmWYpZbZUjoioUy49/2+RrkJO2AQ/HPvejVnx0essGNFs6IJ 3n2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=KP51qsoDsnzDw8hwyR/tzMp85bgwLf40on24ZTmcMNw=; b=IvevVERp86MnBrX4u+EAiT3FXOlaCz99NqK4Ds+a6d5lTv0Yqj0FjDAaG280HFJhQP PWvfyYnqQaNGdOcyK1oH1Fq7Zhcs6lbd0IhslCpVEtcsBhq7IVUFqabKRc8kmOIBlZJi w+7x/ZN8z1cJZX1DRYCoBiY3UBwvZ6yDp6Na3ES0qUiBjZ0c59eArtIyYYCep7yV0Ne8 bMx3/rqZQiWa1qJGogyJRjYFmDb/gjs4upXXCt/b+DBDmkyeEuJij0z5+ot8zxXhVKXM gIYiW14p2xpusHN1nTK546H0F99YlOY/GMGjAr9hMKvfny+1VqE365y1lfpBWOnqqKZr E/UQ== X-Gm-Message-State: ABuFfogOFwGvQtQuYGJ4l2Xf0vHpQTCRtihyukZC2Fi1ISl0RIRg3RY9 5j2ZcKIniDXrdZbOV4xllWCwXdbY X-Google-Smtp-Source: ACcGV6111tPnuyWc8/Or2/jtOSvdN3ACE5G1yZ8WUeri42qM5A2zAQA6b8Tzsw1heMds5C15X1WEnQ== X-Received: by 2002:a63:fd58:: with SMTP id m24-v6mr22098967pgj.132.1539011824275; Mon, 08 Oct 2018 08:17:04 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id v190-v6sm26659773pgb.16.2018.10.08.08.17.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Oct 2018 08:17:03 -0700 (PDT) Date: Mon, 08 Oct 2018 08:17:03 -0700 (PDT) X-Google-Original-Date: Mon, 08 Oct 2018 15:16:57 GMT Message-Id: <9fcbbe336dffb16b7cb5f4de0163404a81597af1.1539011820.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Derrick Stolee via GitGitGadget" Subject: [PATCH 1/3] midx: fix broken free() in close_midx() Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Derrick Stolee Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Derrick Stolee When closing a multi-pack-index, we intend to close each pack-file and free the struct packed_git that represents it. However, this line was previously freeing the array of pointers, not the pointer itself. This leads to a double-free issue. Signed-off-by: Derrick Stolee --- midx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/midx.c b/midx.c index f3e8dbc108..999717b96f 100644 --- a/midx.c +++ b/midx.c @@ -190,7 +190,7 @@ static void close_midx(struct multi_pack_index *m) for (i = 0; i < m->num_packs; i++) { if (m->packs[i]) { close_pack(m->packs[i]); - free(m->packs); + free(m->packs[i]); } } FREE_AND_NULL(m->packs); From patchwork Mon Oct 8 15:17:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Passaro via GitGitGadget X-Patchwork-Id: 10630957 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 77C0715E8 for ; Mon, 8 Oct 2018 15:17:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 693AE28D06 for ; Mon, 8 Oct 2018 15:17:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E00A28F71; Mon, 8 Oct 2018 15:17:08 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 0B12D28D06 for ; Mon, 8 Oct 2018 15:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726510AbeJHW3S (ORCPT ); Mon, 8 Oct 2018 18:29:18 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33720 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbeJHW3S (ORCPT ); Mon, 8 Oct 2018 18:29:18 -0400 Received: by mail-pf1-f196.google.com with SMTP id d4-v6so8539349pfn.0 for ; Mon, 08 Oct 2018 08:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=W22g94jweKpA+BlfEcvGX3Qr1Kzxrnj7ftYnF4HGPlM=; b=dje6rPJe5jNKK/P+g0pt+ydylTU+g3528ZCd2bM8ly6b4FXSMEfAB3t/0wEEtfPCaf xV5vZhgSsxfn1ZcE1bW1QmwyhpTc7N45t+wOiiDXb8+X3VjQKlQ81D2TGGnVBPB659AT Ab5pG5AEgNhe09JQidMzAlXvCVPIYAAfaHgnrfQ1DlZVLcPVFcbY+cfK/43EDvG/UcRJ ssnuHv5ZmqK/w/HEye+6xDkW74AQ9xiT9z9NKCfW7QRUtFF/W1kEPPWigeVHd2gfwndD QJ//ePhXnT6SVhuYo7sLTx+M6EhFi8kiqDl+blBHW4HvZvNiGO6jghU5wmMF/dWQQZzI qOAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=W22g94jweKpA+BlfEcvGX3Qr1Kzxrnj7ftYnF4HGPlM=; b=XSFsUwJdBPgwIwZjKTQu57MAUXWyvYnKzAoJZQr4suSL5l0Y4xqaUKvX5Th3nYcDNo Id66POl6psngmZKuKTlupiJ06mcdEqV1puycbH4wmu7VGjmpiXRgwOL8IGxomIzyNfLn 18b7H8ZDUE1SuOGpeyN8nRl9Y8NP3BA9FoK25sSgIDO4RIIUBugJsm+LR+3uuzA+MB9c 6qQtKKpW3o3aH9g12J8Mjz0WVNotq4Tic2rFuBYtH0fKvXAs4JlN/OFT6D/y/3N+3msf 3LpSbmBNVP6/oVqn7KqDSy4O4u44D/y18pFS/AenkycIaPcnGQcbKyGYgqx/2Ybs6igv fNVA== X-Gm-Message-State: ABuFfojqWks6eE5L530dUL5KxUWXNKzdjEiqOiFpCaLLoUvdHRb+4wL8 m2UK0ipAK1WeYcf+s+zqdcfr18s+ X-Google-Smtp-Source: ACcGV63A2n3trH0PE2sP8MucIsHO0vF03q607R//7CmsTHEbWqfhpDfELgiV7vHD6aFCprz1B91n/A== X-Received: by 2002:a63:f110:: with SMTP id f16-v6mr21684725pgi.236.1539011825875; Mon, 08 Oct 2018 08:17:05 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id x186-v6sm25410504pfx.152.2018.10.08.08.17.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Oct 2018 08:17:05 -0700 (PDT) Date: Mon, 08 Oct 2018 08:17:05 -0700 (PDT) X-Google-Original-Date: Mon, 08 Oct 2018 15:16:58 GMT Message-Id: <725ebadc92a91469eed089eb501b705c2dd2c627.1539011820.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Derrick Stolee via GitGitGadget" Subject: [PATCH 2/3] midx: close multi-pack-index on repack Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Derrick Stolee Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Derrick Stolee When repacking, we may remove pack-files. This invalidates the multi-pack-index (if it exists). Previously, we removed the multi-pack-index file before removing any pack-file. In some cases, the repack command may load the multi-pack-index into memory. This may lead to later in-memory references to the non-existent pack- files. Signed-off-by: Derrick Stolee --- builtin/repack.c | 4 ++++ midx.c | 6 +++++- midx.h | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/builtin/repack.c b/builtin/repack.c index c6a7943d5c..7925bb976e 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -432,6 +432,10 @@ int cmd_repack(int argc, const char **argv, const char *prefix) if (!midx_cleared) { /* if we move a packfile, it will invalidated the midx */ + if (the_repository->objects) { + close_midx(the_repository->objects->multi_pack_index); + the_repository->objects->multi_pack_index = NULL; + } clear_midx_file(get_object_directory()); midx_cleared = 1; } diff --git a/midx.c b/midx.c index 999717b96f..fe8532a9d1 100644 --- a/midx.c +++ b/midx.c @@ -180,9 +180,13 @@ cleanup_fail: return NULL; } -static void close_midx(struct multi_pack_index *m) +void close_midx(struct multi_pack_index *m) { uint32_t i; + + if (!m) + return; + munmap((unsigned char *)m->data, m->data_len); close(m->fd); m->fd = -1; diff --git a/midx.h b/midx.h index a210f1af2a..af6b5cb58f 100644 --- a/midx.h +++ b/midx.h @@ -44,4 +44,6 @@ int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, i int write_midx_file(const char *object_dir); void clear_midx_file(const char *object_dir); +void close_midx(struct multi_pack_index *m); + #endif From patchwork Mon Oct 8 15:17:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Passaro via GitGitGadget X-Patchwork-Id: 10630959 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 4FFF8112B for ; Mon, 8 Oct 2018 15:17:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FFEF212D5 for ; Mon, 8 Oct 2018 15:17:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3487028D32; Mon, 8 Oct 2018 15:17:10 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 85DB8212D5 for ; Mon, 8 Oct 2018 15:17:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726523AbeJHW3U (ORCPT ); Mon, 8 Oct 2018 18:29:20 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37705 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbeJHW3U (ORCPT ); Mon, 8 Oct 2018 18:29:20 -0400 Received: by mail-pl1-f195.google.com with SMTP id az3-v6so10221479plb.4 for ; Mon, 08 Oct 2018 08:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=4K2X/DQ7XSdPmLpTKwl1TzdTYvEmKg//QkKKT4Llcd4=; b=Jt0Cvf/r0FUtJspfU6KHdzMiMBrlG7zYt6V8EEx0BlS/f2/AYE2yi/zPt5T57muN/c bMYPkLnLtr8Xytow7fjnqvSuewLW3jnbHIjDG9MGV5rrZ/xyQYvWUwp/VqI0j9q2uCak K/reXy55CMmqMi9WcFCAbb5+094nTfslUUC2EbcsacjpYfVywuYrY/CniCkRwMJRkmaG rsf7xfksT+VtkX0WbdM2J8O6PjYyYNly30IGE/gLVCsrSBsMmwB8XMFULYs+zxLCzOMh oUoRZtG0HybP4dl3TjzlByLo4+UAOdRmkjLpyKH7UlTXZ3sf4YPnAPQenLMtQ/3gIUWQ 3+Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=4K2X/DQ7XSdPmLpTKwl1TzdTYvEmKg//QkKKT4Llcd4=; b=Ca7ROo9dFSoHVO3H0OuSF5LEOgTEGdHtBgOq8YZZ1gN5+0GVoE8pzFv/i1puAAlwtC 3RNp1FpvKaUrxeFhBNGcNpxEb9JPXj04u19Ivt7Fuilicn6HHoAbenJXVrNGKo+D7BJG KXQ0ffdGjZJmvccBm2lh1uypDeoOyboq3T85Mc/qMg8c3zmzedFx7MiwG7STyCx5aGjB 9IWqW1SiKZV1UkK0HKvyBRWOBO0CCWiiWe+mU+YTQKVSixyASkeQQakGO6cBfrGiRL8k 0w7zuPzTksE601lapwkfDNW5Xw/JQ0mbEdrmjxAdlGDOr2lLpDIDA+OrH2f/hC9IiYF4 PmEg== X-Gm-Message-State: ABuFfohxakcmhFeeHQliWt1JPmllbK178U1x76PGvyEa3YaOEx3RG9ja R0nQk0EDM94wwAsUH7HYnHg4IiI9 X-Google-Smtp-Source: ACcGV61dx8mE+eat2s+CoDDFrszBh5ftNNv1poX6Aw/nQlBrIVTTbyTlAqJd+MdvY+wAW27K05fDig== X-Received: by 2002:a17:902:bcc3:: with SMTP id o3-v6mr25005331pls.202.1539011827374; Mon, 08 Oct 2018 08:17:07 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id z26-v6sm13173963pfh.77.2018.10.08.08.17.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Oct 2018 08:17:06 -0700 (PDT) Date: Mon, 08 Oct 2018 08:17:06 -0700 (PDT) X-Google-Original-Date: Mon, 08 Oct 2018 15:16:59 GMT Message-Id: <04e3e9108266e322a3db827355689c887a9cae8c.1539011820.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Derrick Stolee via GitGitGadget" Subject: [PATCH 3/3] multi-pack-index: define GIT_TEST_MULTI_PACK_INDEX Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Derrick Stolee Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Derrick Stolee The multi-pack-index feature is tested in isolation by t5319-multi-pack-index.sh, but there are many more interesting scenarios in the test suite surrounding pack-file data shapes and interactions. Since the multi-pack-index is an optional data structure, it does not make sense to include it by default in those tests. Instead, add a new GIT_TEST_MULTI_PACK_INDEX environment variable that enables core.multiPackIndex and writes a multi-pack-index after each 'git repack' command. This adds extra test coverage when needed. There are a few spots in the test suite that need to react to this change: * t5319-multi-pack-index.sh: there is a test that checks that 'git repack' deletes the multi-pack-index. Disable the environment variable to ensure this still happens. * t5310-pack-bitmaps.sh: One test moves a pack-file from the object directory to an alternate. This breaks the multi-pack-index, so delete the multi-pack-index at this point, if it exists. * t9300-fast-import.sh: One test verifies the number of files in the .git/objects/pack directory is exactly 8. Exclude the multi-pack-index from this count so it is still 8 in all cases. Signed-off-by: Derrick Stolee --- builtin/repack.c | 4 ++++ midx.c | 9 +++++++-- midx.h | 2 ++ t/README | 4 ++++ t/t5310-pack-bitmaps.sh | 1 + t/t5319-multi-pack-index.sh | 2 +- t/t9300-fast-import.sh | 2 +- 7 files changed, 20 insertions(+), 4 deletions(-) diff --git a/builtin/repack.c b/builtin/repack.c index 7925bb976e..418442bfe2 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -558,6 +558,10 @@ int cmd_repack(int argc, const char **argv, const char *prefix) if (!no_update_server_info) update_server_info(0); remove_temporary_files(); + + if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0)) + write_midx_file(get_object_directory()); + string_list_clear(&names, 0); string_list_clear(&rollback, 0); string_list_clear(&existing_packs, 0); diff --git a/midx.c b/midx.c index fe8532a9d1..aeafb58fa3 100644 --- a/midx.c +++ b/midx.c @@ -338,9 +338,14 @@ int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, i struct multi_pack_index *m; struct multi_pack_index *m_search; int config_value; + static int env_value = -1; - if (repo_config_get_bool(r, "core.multipackindex", &config_value) || - !config_value) + if (env_value < 0) + env_value = git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0); + + if (!env_value && + (repo_config_get_bool(r, "core.multipackindex", &config_value) || + !config_value)) return 0; for (m_search = r->objects->multi_pack_index; m_search; m_search = m_search->next) diff --git a/midx.h b/midx.h index af6b5cb58f..bec8f73d28 100644 --- a/midx.h +++ b/midx.h @@ -3,6 +3,8 @@ #include "repository.h" +#define GIT_TEST_MULTI_PACK_INDEX "GIT_TEST_MULTI_PACK_INDEX" + struct multi_pack_index { struct multi_pack_index *next; diff --git a/t/README b/t/README index 3ea6c85460..9d0277c338 100644 --- a/t/README +++ b/t/README @@ -327,6 +327,10 @@ GIT_TEST_COMMIT_GRAPH=, when true, forces the commit-graph to be written after every 'git commit' command, and overrides the 'core.commitGraph' setting to true. +GIT_TEST_MULTI_PACK_INDEX=, when true, forces the multi-pack- +index to be written after every 'git repack' command, and overrides the +'core.multiPackIndex' setting to true. + Naming Tests ------------ diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh index 1be3459c5b..82d7f7f6a5 100755 --- a/t/t5310-pack-bitmaps.sh +++ b/t/t5310-pack-bitmaps.sh @@ -191,6 +191,7 @@ test_expect_success 'pack-objects respects --honor-pack-keep (local bitmapped pa test_expect_success 'pack-objects respects --local (non-local bitmapped pack)' ' mv .git/objects/pack/$packbitmap.* alt.git/objects/pack/ && + rm -f .git/objects/pack/multi-pack-index && test_when_finished "mv alt.git/objects/pack/$packbitmap.* .git/objects/pack/" && echo HEAD | git pack-objects --local --stdout --revs >3b.pack && git index-pack 3b.pack && diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh index 6f56b38674..4024ff9a39 100755 --- a/t/t5319-multi-pack-index.sh +++ b/t/t5319-multi-pack-index.sh @@ -152,7 +152,7 @@ compare_results_with_midx "twelve packs" test_expect_success 'repack removes multi-pack-index' ' test_path_is_file $objdir/pack/multi-pack-index && - git repack -adf && + GIT_TEST_MULTI_PACK_INDEX=0 git repack -adf && test_path_is_missing $objdir/pack/multi-pack-index ' diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 40fe7e4976..59a13b6a77 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -1558,7 +1558,7 @@ test_expect_success 'O: blank lines not necessary after other commands' ' INPUT_END git fast-import actual && test_cmp expect actual