diff --git a/builtin/fsck.c b/builtin/fsck.c index 64614b43b2..8813d9b5bb 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -798,7 +798,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; @@ -820,7 +820,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 82c92de7ca..849f577cf6 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -1039,9 +1039,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 &&