Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
files-backend: inline resolve_ref_1() into resolve_ref_unsafe()
author
Michael Haggerty
<mhagger@alum.mit.edu>
Thu, 7 Apr 2016 19:03:03 +0000
(15:03 -0400)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 10 Apr 2016 18:35:29 +0000
(11:35 -0700)
resolve_ref_unsafe() wasn't doing anything useful anymore.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
42a38cf
)
diff --git
a/refs/files-backend.c
b/refs/files-backend.c
index f75256882c8a1bc38e323d50e59e5655167b919a..120b2dddf8c534f09422f9129d945f5115396a34 100644
(file)
--- a/
refs/files-backend.c
+++ b/
refs/files-backend.c
@@
-1539,14
+1539,16
@@
static int read_raw_ref(const char *refname, unsigned char *sha1,
}
/* This function needs to return a meaningful errno on failure */
}
/* This function needs to return a meaningful errno on failure */
-static const char *resolve_ref_1(const char *refname,
- int resolve_flags,
- unsigned char *sha1,
- int *flags,
- struct strbuf *sb_refname)
+const char *resolve_ref_unsafe(const char *refname, int resolve_flags,
+ unsigned char *sha1, int *flags)
{
{
+ static struct strbuf sb_refname = STRBUF_INIT;
+ int unused_flags;
int symref_count;
int symref_count;
+ if (!flags)
+ flags = &unused_flags;
+
*flags = 0;
if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
*flags = 0;
if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
@@
-1570,7
+1572,7
@@
static const char *resolve_ref_1(const char *refname,
for (symref_count = 0; symref_count < MAXDEPTH; symref_count++) {
int read_flags = 0;
for (symref_count = 0; symref_count < MAXDEPTH; symref_count++) {
int read_flags = 0;
- if (read_raw_ref(refname, sha1, sb_refname, &read_flags)) {
+ if (read_raw_ref(refname, sha1,
&
sb_refname, &read_flags)) {
*flags |= read_flags;
if (errno != ENOENT || (resolve_flags & RESOLVE_REF_READING))
return NULL;
*flags |= read_flags;
if (errno != ENOENT || (resolve_flags & RESOLVE_REF_READING))
return NULL;
@@
-1590,7
+1592,7
@@
static const char *resolve_ref_1(const char *refname,
return refname;
}
return refname;
}
- refname = sb_refname
->
buf;
+ refname = sb_refname
.
buf;
if (resolve_flags & RESOLVE_REF_NO_RECURSE) {
hashclr(sha1);
return refname;
if (resolve_flags & RESOLVE_REF_NO_RECURSE) {
hashclr(sha1);
return refname;
@@
-1610,21
+1612,6
@@
static const char *resolve_ref_1(const char *refname,
return NULL;
}
return NULL;
}
-const char *resolve_ref_unsafe(const char *refname, int resolve_flags,
- unsigned char *sha1, int *flags)
-{
- static struct strbuf sb_refname = STRBUF_INIT;
- int unused_flags;
- const char *ret;
-
- if (!flags)
- flags = &unused_flags;
-
- ret = resolve_ref_1(refname, resolve_flags, sha1, flags,
- &sb_refname);
- return ret;
-}
-
/*
* Peel the entry (if possible) and return its new peel_status. If
* repeel is true, re-peel the entry even if there is an old peeled
/*
* Peel the entry (if possible) and return its new peel_status. If
* repeel is true, re-peel the entry even if there is an old peeled