Thread (53 messages) 53 messages, 4 authors, 2016-06-15

[PATCH 20/24] for-each-ref.c: improve message before aborting on broken ref

flat view
DORMANTno replies

From: Jonathan Nieder <hidden>
Date: 2016-06-15 23:02:38
Subsystem: the rest · Maintainer: Linus Torvalds

From: Ronnie Sahlberg <redacted>
Date: Fri, 5 Sep 2014 14:35:17 -0700

Print a warning message for any badly named refs we find in the repo.

Signed-off-by: Ronnie Sahlberg <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
As before.

 builtin/for-each-ref.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 20949b7..a88d681 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -853,6 +853,11 @@ static int grab_single_ref(const char *refname, const unsigned char *sha1, int f
 	struct refinfo *ref;
 	int cnt;
 
+	if (flag & REF_BAD_NAME) {
+		  warning("ignoring ref with broken name %s", refname);
+		  return 0;
+	}
+
 	if (*cb->grab_pattern) {
 		const char **pattern;
 		int namelen = strlen(refname);
-- 
2.1.0.rc2.206.gedb03e5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help