Merge branch 'jk/fsck-indices-in-worktrees'
Code clarification. * jk/fsck-indices-in-worktrees: fsck: avoid misleading variable namemaint
commit
b00ec259e7
|
@ -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,
|
static void fsck_index(struct index_state *istate, const char *index_path,
|
||||||
int is_main_index)
|
int is_current_worktree)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -832,7 +832,7 @@ static void fsck_index(struct index_state *istate, const char *index_path,
|
||||||
obj->flags |= USED;
|
obj->flags |= USED;
|
||||||
fsck_put_object_name(&fsck_walk_options, &obj->oid,
|
fsck_put_object_name(&fsck_walk_options, &obj->oid,
|
||||||
"%s:%s",
|
"%s:%s",
|
||||||
is_main_index ? "" : index_path,
|
is_current_worktree ? "" : index_path,
|
||||||
istate->cache[i]->name);
|
istate->cache[i]->name);
|
||||||
mark_object_reachable(obj);
|
mark_object_reachable(obj);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1036,9 +1036,9 @@ test_expect_success 'fsck detects problems in worktree index' '
|
||||||
test_cmp expect actual
|
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" &&
|
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 &&
|
git add file &&
|
||||||
blob=$(git rev-parse :file) &&
|
blob=$(git rev-parse :file) &&
|
||||||
remove_object $blob &&
|
remove_object $blob &&
|
||||||
|
|
Loading…
Reference in New Issue