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>
Michael Haggerty committed
Oct 1, 2014 at 12:28 UTC
216aab1e3d8eef088dc9785febce24a110e9f835
2 files changed
+8
-8
lockfile.c
-8
@@ -340,14 +340,6 @@ int commit_lock_file(struct lock_file *lk)
340
return err;
341
}
342
343
-int hold_locked_index(struct lock_file *lk, int die_on_error)
344
-{
345
- return hold_lock_file_for_update(lk, get_index_file(),
346
- die_on_error
347
- ? LOCK_DIE_ON_ERROR
348
- : 0);
349
-}
350
-
343
void rollback_lock_file(struct lock_file *lk)
344
{
345
if (!lk->active)
read-cache.c
+8
@@ -1367,6 +1367,14 @@ static int read_index_extension(struct index_state *istate,
1367
return 0;
1368
}
1369
1370
+int hold_locked_index(struct lock_file *lk, int die_on_error)
1371
+{
1372
+ return hold_lock_file_for_update(lk, get_index_file(),
1373
+ die_on_error
1374
+ ? LOCK_DIE_ON_ERROR
1375
+ : 0);
1376
+}
1377
+
1378
int read_index(struct index_state *istate)
1379
{
1380
return read_index_from(istate, get_index_file());