Re: [PATCH 3/3] Add --contains flag to git tag
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 23, 2009, 01:18 UTC
- Message-ID
- <7v1vuu6cr6.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <497913EE.9040608@vivisimo.com>
Jake Goulding <goulding@vivisimo.com> writes:
Show 9 quoted lines
> @@ -34,7 +35,6 @@ static int show_reference(const char *refname, const
> unsigned char *sha1,
> int flag, void *cb_data)
> {
> struct tag_filter *filter = cb_data;
> -
> if (!fnmatch(filter->pattern, refname, 0)) {
> int i;
> unsigned long size;Here you can see a long line wrapped.
What does this hunk have to do with adding --contains option anyway?
Show 12 quoted lines
> @@ -42,6 +42,18 @@ static int show_reference(const char *refname, const
> unsigned char *sha1,
> char *buf, *sp, *eol;
> size_t len;
>
> + if (filter->with_commit) {
> + struct commit *commit;
> +
> + commit = lookup_commit_reference_gently(sha1, 1);
> + if (!commit) {
> + error("tag '%s' does not point at a commit", refname);
> + return 0;Drop this error() call, and just return silently. A tag that does not point at a commit is not an error at all.