refs.c: make close_ref() and commit_ref() non-static
This is in preparation to the reflog-expire changes which will allow updating the ref after expiring the reflog. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Casey committed
Feb 22, 2008 at 12:57 UTC
435fc8523fd3a625acfeebffe433f1f7516ab9e2
2 files changed
+8
-2
refs.c
+2
-2
@@ -1018,7 +1018,7 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg)
1018
return 1;
1019
}
1020
1021
-static int close_ref(struct ref_lock *lock)
1021
+int close_ref(struct ref_lock *lock)
1022
{
1023
if (close_lock_file(lock->lk))
1024
return -1;
@@ -1026,7 +1026,7 @@ static int close_ref(struct ref_lock *lock)
1026
return 0;
1027
}
1028
1029
-static int commit_ref(struct ref_lock *lock)
1029
+int commit_ref(struct ref_lock *lock)
1030
{
1031
if (commit_lock_file(lock->lk))
1032
return -1;
refs.h
+6
@@ -33,6 +33,12 @@ extern struct ref_lock *lock_ref_sha1(const char *ref, const unsigned char *old_
33
#define REF_NODEREF 0x01
34
extern struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *old_sha1, int flags);
35
36
+/** Close the file descriptor owned by a lock and return the status */
37
+extern int close_ref(struct ref_lock *lock);
38
+
39
+/** Close and commit the ref locked by the lock */
40
+extern int commit_ref(struct ref_lock *lock);
41
+
42
/** Release any lock taken but not written. **/
43
extern void unlock_ref(struct ref_lock *lock);
44