From: Michael Haggerty Date: Wed, 1 Oct 2014 10:28:41 +0000 (+0200) Subject: hold_locked_index(): move from lockfile.c to read-cache.c X-Git-Tag: v2.2.0-rc0~53^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/216aab1e3d8eef088dc9785febce24a110e9f835?ds=inline 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 Signed-off-by: Junio C Hamano --- diff --git a/lockfile.c b/lockfile.c index b2f5d36f7e..63f4e94bce 100644 --- a/lockfile.c +++ b/lockfile.c @@ -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) diff --git a/read-cache.c b/read-cache.c index e887e23fb6..9f137e7f27 100644 --- a/read-cache.c +++ b/read-cache.c @@ -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());