commit_lock_file_to(): refactor a helper out of commit_lock_file()
commit_locked_index(), when writing to an alternate index file, duplicates (poorly) the code in commit_lock_file(). And anyway, it shouldn't have to know so much about the internal workings of lockfile objects. So extract a new function commit_lock_file_to() that does the work common to the two functions, and call it from both commit_lock_file() and commit_locked_index(). Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
0c0d6e8601
commit
751bacedaa
1
cache.h
1
cache.h
@ -590,6 +590,7 @@ extern void unable_to_lock_message(const char *path, int err,
|
||||
extern NORETURN void unable_to_lock_die(const char *path, int err);
|
||||
extern int hold_lock_file_for_update(struct lock_file *, const char *path, int);
|
||||
extern int hold_lock_file_for_append(struct lock_file *, const char *path, int);
|
||||
extern int commit_lock_file_to(struct lock_file *, const char *path);
|
||||
extern int commit_lock_file(struct lock_file *);
|
||||
extern int reopen_lock_file(struct lock_file *);
|
||||
extern void update_index_if_able(struct index_state *, struct lock_file *);
|
||||
|
Reference in New Issue
Block a user