aboutsummaryrefslogtreecommitdiffstats
path: root/refs.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-10-08 14:08:15 -0700
committerJunio C Hamano <gitster@pobox.com>2021-10-08 15:06:05 -0700
commit9bc45a28026eaea42011e8c1884aa2d9dc30f947 (patch)
tree96ebd3f3bfb706e4d534bbf0de7f9223fddf32f3 /refs.c
parent34224e14d6b50cb04430188332362e6a0327e5ed (diff)
downloadgit-9bc45a28026eaea42011e8c1884aa2d9dc30f947.tar.gz
refs: teach arbitrary repo support to iterators
Note that should_pack_ref() is called when writing refs, which is only supported for the_repository, hence the_repository is hardcoded there. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 9c4e388153..c07aeff6f4 100644
--- a/refs.c
+++ b/refs.c
@@ -255,12 +255,13 @@ int refname_is_safe(const char *refname)
* does not exist, emit a warning and return false.
*/
int ref_resolves_to_object(const char *refname,
+ struct repository *repo,
const struct object_id *oid,
unsigned int flags)
{
if (flags & REF_ISBROKEN)
return 0;
- if (!has_object_file(oid)) {
+ if (!repo_has_object_file(repo, oid)) {
error(_("%s does not point to a valid object!"), refname);
return 0;
}