summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2b81fab)
raw | patch | inline | side by side (parent: 2b81fab)
author | Brandon Casey <casey@nrlssc.navy.mil> | |
Fri, 22 Feb 2008 18:57:30 +0000 (12:57 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 23 Feb 2008 06:57:38 +0000 (22:57 -0800) |
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>
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>
refs.c | patch | blob | history | |
refs.h | patch | blob | history |
index 67d2a502afb60050f0ce750c21ae1a42fa5cb803..bc654299c9b5d7ab143c138e7f4e825691f2b12b 100644 (file)
--- a/refs.c
+++ b/refs.c
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;
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;
index 9cd16f82956d89f2800827046151abd7866fb9da..06abee15266cc3b234ec64cd27362c482874e54b 100644 (file)
--- a/refs.h
+++ b/refs.h
#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);