Skip to content

Commit

Permalink
hold_locked_index(): move from lockfile.c to read-cache.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Oct 1, 2014
1 parent 4d423a3 commit 216aab1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions lockfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions read-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 216aab1

Please sign in to comment.