summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-07-08 11:23:08 -0700
committerJunio C Hamano <gitster@pobox.com>2023-07-08 11:23:08 -0700
commitb00ec259e735fcb0dc4f697b7cc98b2730879d63 (patch)
treeec3c5a63dfd4b64320583e16a4c4c5dad029ddba
parent7f5ad0ca8d1d7db7a21755af34251714d86b2ec1 (diff)
parent6e6a529b573398f0a8828551cf04dafb4f084c9a (diff)
Merge branch 'jk/fsck-indices-in-worktrees'
Code clarification. * jk/fsck-indices-in-worktrees: fsck: avoid misleading variable name
-rw-r--r--builtin/fsck.c4
-rwxr-xr-xt/t1450-fsck.sh4
2 files changed, 4 insertions, 4 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index fa26462337..3aa9c812eb 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -810,7 +810,7 @@ static int fsck_resolve_undo(struct index_state *istate,
}
static void fsck_index(struct index_state *istate, const char *index_path,
- int is_main_index)
+ int is_current_worktree)
{
unsigned int i;
@@ -832,7 +832,7 @@ static void fsck_index(struct index_state *istate, const char *index_path,
obj->flags |= USED;
fsck_put_object_name(&fsck_walk_options, &obj->oid,
"%s:%s",
- is_main_index ? "" : index_path,
+ is_current_worktree ? "" : index_path,
istate->cache[i]->name);
mark_object_reachable(obj);
}
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index 8c442adb1a..5805d47eb9 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -1036,9 +1036,9 @@ test_expect_success 'fsck detects problems in worktree index' '
test_cmp expect actual
'
-test_expect_success 'fsck reports problems in main index without filename' '
+test_expect_success 'fsck reports problems in current worktree index without filename' '
test_when_finished "rm -f .git/index && git read-tree HEAD" &&
- echo "this object will be removed to break the main index" >file &&
+ echo "this object will be removed to break current worktree index" >file &&
git add file &&
blob=$(git rev-parse :file) &&
remove_object $blob &&