Skip to content

Commit b00ec25

Browse files
committed
Merge branch 'jk/fsck-indices-in-worktrees'
Code clarification. * jk/fsck-indices-in-worktrees: fsck: avoid misleading variable name
2 parents 7f5ad0c + 6e6a529 commit b00ec25

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

builtin/fsck.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ static int fsck_resolve_undo(struct index_state *istate,
810810
}
811811

812812
static void fsck_index(struct index_state *istate, const char *index_path,
813-
int is_main_index)
813+
int is_current_worktree)
814814
{
815815
unsigned int i;
816816

@@ -832,7 +832,7 @@ static void fsck_index(struct index_state *istate, const char *index_path,
832832
obj->flags |= USED;
833833
fsck_put_object_name(&fsck_walk_options, &obj->oid,
834834
"%s:%s",
835-
is_main_index ? "" : index_path,
835+
is_current_worktree ? "" : index_path,
836836
istate->cache[i]->name);
837837
mark_object_reachable(obj);
838838
}

t/t1450-fsck.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,9 +1036,9 @@ test_expect_success 'fsck detects problems in worktree index' '
10361036
test_cmp expect actual
10371037
'
10381038

1039-
test_expect_success 'fsck reports problems in main index without filename' '
1039+
test_expect_success 'fsck reports problems in current worktree index without filename' '
10401040
test_when_finished "rm -f .git/index && git read-tree HEAD" &&
1041-
echo "this object will be removed to break the main index" >file &&
1041+
echo "this object will be removed to break current worktree index" >file &&
10421042
git add file &&
10431043
blob=$(git rev-parse :file) &&
10441044
remove_object $blob &&

0 commit comments

Comments
 (0)