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>
Michael Haggerty committed
Sep 4, 2016 at 18:08 UTC
b9180c9d5d13366e228130eb0d2f1451f2e4dfd6
1 file changed
+5
-21
refs/files-backend.c
+5
-21
@@ -1490,25 +1490,6 @@ static void unlock_ref(struct ref_lock *lock)
1490
1491
#define MAXREFLEN (1024)
1492
1493
-/*
1494
- * Called by resolve_gitlink_ref_recursive() after it failed to read
1495
- * from the loose refs in refs. Find <refname> in the packed-refs file
1496
- * for the submodule.
1497
- */
1498
-static int resolve_gitlink_packed_ref(struct files_ref_store *refs,
1499
- const char *refname, unsigned char *sha1)
1500
-{
1501
- struct ref_entry *ref;
1502
- struct ref_dir *dir = get_packed_refs(refs);
1503
-
1504
- ref = find_ref(dir, refname);
1505
- if (ref == NULL)
1506
- return -1;
1507
-
1508
- hashcpy(sha1, ref->u.value.oid.hash);
1509
- return 0;
1510
-}
1511
-
1493
static int resolve_gitlink_ref_recursive(struct files_ref_store *refs,
1494
const char *refname, unsigned char *sha1,
1495
int recursion)
@@ -1524,8 +1505,11 @@ static int resolve_gitlink_ref_recursive(struct files_ref_store *refs,
1505
: git_pathdup("%s", refname);
1506
fd = open(path, O_RDONLY);
1507
free(path);
1527
- if (fd < 0)
1528
- return resolve_gitlink_packed_ref(refs, refname, sha1);
1508
+ if (fd < 0) {
1509
+ unsigned int flags;
1510
+
1511
+ return resolve_packed_ref(refs, refname, sha1, &flags);
1512
+ }
1513
1514
len = read(fd, buffer, sizeof(buffer)-1);
1515
close(fd);