1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-06 14:36:18 +02:00

hold_locked_index(): move from lockfile.c to read-cache.c

lockfile.c contains the general API for locking any file. Code
specifically about the index file doesn't belong here.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael Haggerty 2014-10-01 12:28:41 +02:00 committed by Junio C Hamano
parent 4d423a3e62
commit 216aab1e3d
2 changed files with 8 additions and 8 deletions

View File

@ -340,14 +340,6 @@ int commit_lock_file(struct lock_file *lk)
return err;
}
int hold_locked_index(struct lock_file *lk, int die_on_error)
{
return hold_lock_file_for_update(lk, get_index_file(),
die_on_error
? LOCK_DIE_ON_ERROR
: 0);
}
void rollback_lock_file(struct lock_file *lk)
{
if (!lk->active)

View File

@ -1367,6 +1367,14 @@ static int read_index_extension(struct index_state *istate,
return 0;
}
int hold_locked_index(struct lock_file *lk, int die_on_error)
{
return hold_lock_file_for_update(lk, get_index_file(),
die_on_error
? LOCK_DIE_ON_ERROR
: 0);
}
int read_index(struct index_state *istate)
{
return read_index_from(istate, get_index_file());