Skip to content

Commit 435fc85

Browse files
drafnelgitster
authored andcommitted
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>
1 parent 2b81fab commit 435fc85

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

refs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,15 +1018,15 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg)
10181018
return 1;
10191019
}
10201020

1021-
static int close_ref(struct ref_lock *lock)
1021+
int close_ref(struct ref_lock *lock)
10221022
{
10231023
if (close_lock_file(lock->lk))
10241024
return -1;
10251025
lock->lock_fd = -1;
10261026
return 0;
10271027
}
10281028

1029-
static int commit_ref(struct ref_lock *lock)
1029+
int commit_ref(struct ref_lock *lock)
10301030
{
10311031
if (commit_lock_file(lock->lk))
10321032
return -1;

refs.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ extern struct ref_lock *lock_ref_sha1(const char *ref, const unsigned char *old_
3333
#define REF_NODEREF 0x01
3434
extern struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *old_sha1, int flags);
3535

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+
3642
/** Release any lock taken but not written. **/
3743
extern void unlock_ref(struct ref_lock *lock);
3844

0 commit comments

Comments
 (0)