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>
This commit is contained in:

committed by
Junio C Hamano

parent
34224e14d6
commit
9bc45a2802
3
refs.c
3
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user