diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2016-09-04 18:08:19 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-09 15:28:12 -0700 |
commit | b9180c9d5d13366e228130eb0d2f1451f2e4dfd6 (patch) | |
tree | e31b7580c98fa659c0fc963446cfd353c1c2b53b | |
parent | resolve_packed_ref(): rename function from resolve_missing_loose_ref() (diff) | |
download | tgif-b9180c9d5d13366e228130eb0d2f1451f2e4dfd6.tar.xz |
resolve_gitlink_packed_ref(): remove function
Now that resolve_packed_ref() can work with an arbitrary
files_ref_store, there is no need to have a separate
resolve_gitlink_packed_ref() function.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | refs/files-backend.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index 924bdda193..5a76f893e1 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1490,25 +1490,6 @@ static void unlock_ref(struct ref_lock *lock) #define MAXREFLEN (1024) -/* - * Called by resolve_gitlink_ref_recursive() after it failed to read - * from the loose refs in refs. Find <refname> in the packed-refs file - * for the submodule. - */ -static int resolve_gitlink_packed_ref(struct files_ref_store *refs, - const char *refname, unsigned char *sha1) -{ - struct ref_entry *ref; - struct ref_dir *dir = get_packed_refs(refs); - - ref = find_ref(dir, refname); - if (ref == NULL) - return -1; - - hashcpy(sha1, ref->u.value.oid.hash); - return 0; -} - static int resolve_gitlink_ref_recursive(struct files_ref_store *refs, const char *refname, unsigned char *sha1, int recursion) @@ -1524,8 +1505,11 @@ static int resolve_gitlink_ref_recursive(struct files_ref_store *refs, : git_pathdup("%s", refname); fd = open(path, O_RDONLY); free(path); - if (fd < 0) - return resolve_gitlink_packed_ref(refs, refname, sha1); + if (fd < 0) { + unsigned int flags; + + return resolve_packed_ref(refs, refname, sha1, &flags); + } len = read(fd, buffer, sizeof(buffer)-1); close(fd); |