Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 3/3] Add --contains flag to git tag

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:00

Jake Goulding [off-list ref] writes:
quoted hunk
@@ -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?
quoted hunk
@@ -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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help