diff options
| author | Stefan Beller <sbeller@google.com> | 2015-01-23 12:04:00 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2015-01-23 15:19:26 -0800 |
| commit | a92501c68d2efd6671ddfdeb4a061180de462d39 (patch) | |
| tree | 77bceed3be4b0845a3ff93f310a2c02030ae9f39 | |
| parent | d4ad3f1cdcb61f07dff9738111238b2974c50288 (diff) | |
| download | git-a92501c68d2efd6671ddfdeb4a061180de462d39.tar.gz | |
refs.c: move static functions to close and commit refs
By moving the functions up we don't need to have to declare them first
when using them in a later patch.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rw-r--r-- | refs.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -2808,6 +2808,20 @@ static int rename_ref_available(const char *oldname, const char *newname) static int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *logmsg); +static int close_ref(struct ref_lock *lock) +{ + if (close_lock_file(lock->lk)) + return -1; + return 0; +} + +static int commit_ref(struct ref_lock *lock) +{ + if (commit_lock_file(lock->lk)) + return -1; + return 0; +} + int rename_ref(const char *oldrefname, const char *newrefname, const char *logmsg) { unsigned char sha1[20], orig_sha1[20]; @@ -2898,20 +2912,6 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms return 1; } -static int close_ref(struct ref_lock *lock) -{ - if (close_lock_file(lock->lk)) - return -1; - return 0; -} - -static int commit_ref(struct ref_lock *lock) -{ - if (commit_lock_file(lock->lk)) - return -1; - return 0; -} - /* * copy the reflog message msg to buf, which has been allocated sufficiently * large, while cleaning up the whitespaces. Especially, convert LF to space, |
