hold_locked_index(): move from lockfile.c to read-cache.c
authorMichael Haggerty <mhagger@alum.mit.edu>
Wed, 1 Oct 2014 10:28:41 +0000 (12:28 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Oct 2014 20:54:31 +0000 (13:54 -0700)
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>
lockfile.c
read-cache.c
index b2f5d36f7e944798afdd9ae5b591b3dd03eadf7b..63f4e94bce4f84bcd10094a61033c2faa9975422 100644 (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)
index e887e23fb6a8c345ec76c48eabb90f1699a81bdc..9f137e7f27fa8db36c7bb3cfb0848b4595331dea 100644 (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());