Thread (30 messages) 30 messages, 2 authors, 2016-06-15

Re: [PATCH v2 22/24] lock_any_ref_for_update(): inline function

From: Stefan Beller <hidden>
Date: 2016-06-15 23:03:17

On Fri, Dec 12, 2014 at 12:57 AM, Michael Haggerty [off-list ref] wrote:
Inline the function at its one remaining caller (which is within
refs.c) and remove it.

Signed-off-by: Michael Haggerty <redacted>
Reviewed-by: Stefan Beller <redacted>
quoted hunk ↗ jump to hunk
---
 refs.c | 9 +--------
 refs.h | 9 +--------
 2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/refs.c b/refs.c
index 618ef9c..166c0f6 100644
--- a/refs.c
+++ b/refs.c
@@ -2346,13 +2346,6 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
        return NULL;
 }

-struct ref_lock *lock_any_ref_for_update(const char *refname,
-                                        const unsigned char *old_sha1,
-                                        int flags, int *type_p)
-{
-       return lock_ref_sha1_basic(refname, old_sha1, NULL, flags, type_p);
-}
-
 /*
  * Write an entry to the packed-refs file for the specified refname.
  * If peeled is non-NULL, write it as the entry's peeled value.
@@ -4007,7 +4000,7 @@ extern int reflog_expire(const char *refname, const unsigned char *sha1,
         * reference itself, plus we might need to update the
         * reference if --updateref was specified:
         */
-       lock = lock_any_ref_for_update(refname, sha1, 0, NULL);
+       lock = lock_ref_sha1_basic(refname, sha1, NULL, 0, NULL);
        if (!lock)
                return error("cannot lock ref '%s'", refname);
        if (!reflog_exists(refname)) {
diff --git a/refs.h b/refs.h
index 4bb58b9..28e7834 100644
--- a/refs.h
+++ b/refs.h
@@ -181,8 +181,7 @@ extern int is_branch(const char *refname);
 extern int peel_ref(const char *refname, unsigned char *sha1);

 /*
- * Flags controlling lock_any_ref_for_update(), ref_transaction_update(),
- * ref_transaction_create(), etc.
+ * Flags controlling ref_transaction_update(), ref_transaction_create(), etc.
  * REF_NODEREF: act on the ref directly, instead of dereferencing
  *              symbolic references.
  * REF_DELETING: tolerate broken refs
@@ -191,12 +190,6 @@ extern int peel_ref(const char *refname, unsigned char *sha1);
  */
 #define REF_NODEREF    0x01
 #define REF_DELETING   0x02
-/*
- * This function sets errno to something meaningful on failure.
- */
-extern struct ref_lock *lock_any_ref_for_update(const char *refname,
-                                               const unsigned char *old_sha1,
-                                               int flags, int *type_p);

 /*
  * Setup reflog before using. Set errno to something meaningful on failure.
--
2.1.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help