mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
repository.c: replace hold_locked_index() with repo_hold_locked_index()
hold_locked_index() assumes the index path at $GIT_DIR/index. This is not good for places that take an arbitrary index_state instead of the_index, which is basically everywhere except builtin/. Replace it with repo_hold_locked_index(). hold_locked_index() remains as a wrapper around repo_hold_locked_index() to reduce changes in builtin/ Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1d18d7581c
commit
3a95f31d1c
@@ -2375,7 +2375,7 @@ int require_clean_work_tree(struct repository *r,
|
||||
struct lock_file lock_file = LOCK_INIT;
|
||||
int err = 0, fd;
|
||||
|
||||
fd = hold_locked_index(&lock_file, 0);
|
||||
fd = repo_hold_locked_index(r, &lock_file, 0);
|
||||
refresh_index(r->index, REFRESH_QUIET, NULL, NULL, NULL);
|
||||
if (0 <= fd)
|
||||
update_index_if_able(r->index, &lock_file);
|
||||
|
||||
Reference in New Issue
Block a user