Skip to content

Commit 216aab1

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4d423a3 commit 216aab1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lockfile.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,6 @@ int commit_lock_file(struct lock_file *lk)
340340
return err;
341341
}
342342

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-
351343
void rollback_lock_file(struct lock_file *lk)
352344
{
353345
if (!lk->active)

read-cache.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,14 @@ static int read_index_extension(struct index_state *istate,
13671367
return 0;
13681368
}
13691369

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+
13701378
int read_index(struct index_state *istate)
13711379
{
13721380
return read_index_from(istate, get_index_file());

0 commit comments

Comments
 (0)