Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH 2/4] refs.c: make close_ref() and commit_ref() non-static

From: Brandon Casey <hidden>
Date: 2016-06-15 22:44:15
Subsystem: the rest · Maintainer: Linus Torvalds

This is in preparation to the reflog-expire changes which will
allow updating the ref after expiring the reflog.

Signed-off-by: Brandon Casey <redacted>
---
 refs.c |    4 ++--
 refs.h |    6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index 67d2a50..bc65429 100644
--- a/refs.c
+++ b/refs.c
@@ -1018,7 +1018,7 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg)
 	return 1;
 }
 
-static int close_ref(struct ref_lock *lock)
+int close_ref(struct ref_lock *lock)
 {
 	if (close_lock_file(lock->lk))
 		return -1;
@@ -1026,7 +1026,7 @@ static int close_ref(struct ref_lock *lock)
 	return 0;
 }
 
-static int commit_ref(struct ref_lock *lock)
+int commit_ref(struct ref_lock *lock)
 {
 	if (commit_lock_file(lock->lk))
 		return -1;
diff --git a/refs.h b/refs.h
index 9cd16f8..06abee1 100644
--- a/refs.h
+++ b/refs.h
@@ -33,6 +33,12 @@ extern struct ref_lock *lock_ref_sha1(const char *ref, const unsigned char *old_
 #define REF_NODEREF	0x01
 extern struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *old_sha1, int flags);
 
+/** Close the file descriptor owned by a lock and return the status */
+extern int close_ref(struct ref_lock *lock);
+
+/** Close and commit the ref locked by the lock */
+extern int commit_ref(struct ref_lock *lock);
+
 /** Release any lock taken but not written. **/
 extern void unlock_ref(struct ref_lock *lock);
 
-- 
1.5.4.2.267.g38ea
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help