Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
resolve_missing_loose_ref(): add a files_ref_store argument
author
Michael Haggerty
<mhagger@alum.mit.edu>
Sun, 4 Sep 2016 16:08:14 +0000
(18:08 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 9 Sep 2016 22:28:12 +0000
(15:28 -0700)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
f0d21ef
)
diff --git
a/refs/files-backend.c
b/refs/files-backend.c
index 16d5b9f14baec66937218ab2c4fc69c8af1c245a..9c81af900c1805e26d623e2a560c5ab0f67212d2 100644
(file)
--- a/
refs/files-backend.c
+++ b/
refs/files-backend.c
@@
-1412,13
+1412,11
@@
static struct ref_entry *get_packed_ref(struct files_ref_store *refs,
/*
* A loose ref file doesn't exist; check for a packed ref.
*/
/*
* A loose ref file doesn't exist; check for a packed ref.
*/
-static int resolve_missing_loose_ref(const char *refname,
+static int resolve_missing_loose_ref(struct files_ref_store *refs,
+ const char *refname,
unsigned char *sha1,
unsigned int *flags)
{
unsigned char *sha1,
unsigned int *flags)
{
- struct files_ref_store *refs =
- get_files_ref_store(NULL, "resolve_missing_loose_ref");
-
struct ref_entry *entry;
/*
struct ref_entry *entry;
/*
@@
-1438,6
+1436,8
@@
static int resolve_missing_loose_ref(const char *refname,
int read_raw_ref(const char *refname, unsigned char *sha1,
struct strbuf *referent, unsigned int *type)
{
int read_raw_ref(const char *refname, unsigned char *sha1,
struct strbuf *referent, unsigned int *type)
{
+ struct files_ref_store *refs =
+ get_files_ref_store(NULL, "read_raw_ref");
struct strbuf sb_contents = STRBUF_INIT;
struct strbuf sb_path = STRBUF_INIT;
const char *path;
struct strbuf sb_contents = STRBUF_INIT;
struct strbuf sb_path = STRBUF_INIT;
const char *path;
@@
-1466,7
+1466,7
@@
int read_raw_ref(const char *refname, unsigned char *sha1,
if (lstat(path, &st) < 0) {
if (errno != ENOENT)
goto out;
if (lstat(path, &st) < 0) {
if (errno != ENOENT)
goto out;
- if (resolve_missing_loose_ref(refname, sha1, type)) {
+ if (resolve_missing_loose_ref(ref
s, ref
name, sha1, type)) {
errno = ENOENT;
goto out;
}
errno = ENOENT;
goto out;
}
@@
-1500,7
+1500,7
@@
int read_raw_ref(const char *refname, unsigned char *sha1,
* ref is supposed to be, there could still be a
* packed ref:
*/
* ref is supposed to be, there could still be a
* packed ref:
*/
- if (resolve_missing_loose_ref(refname, sha1, type)) {
+ if (resolve_missing_loose_ref(ref
s, ref
name, sha1, type)) {
errno = EISDIR;
goto out;
}
errno = EISDIR;
goto out;
}