Skip to content

Commit

Permalink
refs.c: make close_ref() and commit_ref() non-static
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Feb 23, 2008
1 parent 2b81fab commit 435fc85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,15 +1018,15 @@ 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;
lock->lock_fd = -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;
Expand Down
6 changes: 6 additions & 0 deletions refs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 435fc85

Please sign in to comment.