Re: [PATCH 02/16] refs: add methods for misc ref operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Turner <dturner@xxxxxxxxxxxxxxxx> writes:

> diff --git a/cache.h b/cache.h
> index 51c35c3..707455a 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -1111,6 +1111,13 @@ extern char *oid_to_hex(const struct object_id *oid);	/* same static buffer as s
>  extern int interpret_branch_name(const char *str, int len, struct strbuf *);
>  extern int get_sha1_mb(const char *str, unsigned char *sha1);
>  
> +/*
> + * Return true iff abbrev_name is a possible abbreviation for
> + * full_name according to the rules defined by ref_rev_parse_rules in
> + * refs.c.
> + */
> +extern int refname_match(const char *abbrev_name, const char *full_name);
> +
>  extern int validate_headref(const char *ref);

This hunk is strange.  It duplicates what is in refs.h, risking the
two copies to drift away from each other over time.

As the only callsites are in remote.c that includes refs.h, this
probably should be dropped.

Other changes that give redirection to various operations via vtable
looked all sensible.

>  struct ref_be {
>  	struct ref_be *next;
>  	const char *name;
>  	ref_transaction_commit_fn *transaction_commit;
> +
> +	pack_refs_fn *pack_refs;
> +	peel_ref_fn *peel_ref;
> +	create_symref_fn *create_symref;
> +
> +	resolve_ref_unsafe_fn *resolve_ref_unsafe;
> +	verify_refname_available_fn *verify_refname_available;
> +	resolve_gitlink_ref_fn *resolve_gitlink_ref;
>  };
>  
>  #endif /* REFS_REFS_INTERNAL_H */
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]