Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: "Anh Le via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Timothy Jones <timothy@canva.com>,
	Jeff Hostetler <jeffhost@microsoft.com>,
	Jeff Hostetler <git@jeffhostetler.com>,
	Derrick Stolee <derrickstolee@github.com>,
	Taylor Blau <me@ttaylorr.com>, Anh Le <anh@canva.com>,
	Anh Le <anh@canva.com>
Subject: [PATCH v4 2/2] index: raise a bug if the index is materialised more than once
Date: Thu, 03 Nov 2022 23:05:01 +0000	[thread overview]
Message-ID: <91ad797330731e48907767d13213c8d8f899d996.1667516701.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1368.v4.git.git.1667516701.gitgitgadget@gmail.com>

From: Anh Le <anh@canva.com>

If clear_skip_worktree_from_present_files() encounter a sparse directory,
it fully materialise the index which should expand any sparse directories
and start going through each entries again. If this happens more than once,
raise it with a BUG.

Signed-off-by: Anh Le <anh@canva.com>
---
 sparse-index.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sparse-index.c b/sparse-index.c
index 8713a15611d..8c269dab803 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -510,6 +510,8 @@ restart:
 			path_count[restarted]++;
 			if (path_found(ce->name, &last_dirname, &dir_len, &dir_found)) {
 				if (S_ISSPARSEDIR(ce->ce_mode)) {
+					if (restarted)
+						BUG("ensure-full-index did not fully flatten?");
 					ensure_full_index(istate);
 					restarted = 1;
 					goto restart;
-- 
gitgitgadget

  parent reply	other threads:[~2022-11-03 23:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26  0:05 [PATCH] index: add trace2 region for clear skip worktree Anh Le via GitGitGadget
2022-10-26  3:16 ` Junio C Hamano
2022-10-26 14:13   ` Jeff Hostetler
2022-10-26 16:01     ` Junio C Hamano
2022-10-26 18:29       ` Jeff Hostetler
2022-10-27  0:04         ` Anh Le
2022-10-28  0:46 ` [PATCH v2] " Anh Le via GitGitGadget
2022-10-28 15:49   ` Derrick Stolee
2022-10-28 17:17     ` Junio C Hamano
2022-10-30 23:28       ` Anh Le
2022-10-28 16:50   ` Jeff Hostetler
2022-10-31  0:56   ` [PATCH v3] " Anh Le via GitGitGadget
2022-10-31 22:34     ` Taylor Blau
2022-11-03 23:04     ` [PATCH v4 0/2] " Anh Le via GitGitGadget
2022-11-03 23:05       ` [PATCH v4 1/2] " Anh Le via GitGitGadget
2022-11-03 23:05       ` Anh Le via GitGitGadget [this message]
2022-11-05  0:29       ` [PATCH v4 0/2] " Taylor Blau
2022-11-07 20:50         ` Derrick Stolee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91ad797330731e48907767d13213c8d8f899d996.1667516701.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=anh@canva.com \
    --cc=derrickstolee@github.com \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=jeffhost@microsoft.com \
    --cc=me@ttaylorr.com \
    --cc=timothy@canva.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).