Thread (18 messages) flat view 18 messages, 3 authors, 2016-06-15

Re: [PATCH v2 1/2] rev-parse: exit with non-zero status if ref@{n} is not valid.

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:22
Subsystem: the rest · Maintainer: Linus Torvalds

Jon Seymour wrote:
quoted hunk ↗ jump to hunk
+++ b/sha1_name.c
@@ -342,7 +342,7 @@ static int get_sha1_1(const char *name, int len, unsigned char *sha1);
 
 static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
 {
-	static const char *warning = "warning: refname '%.*s' is ambiguous.\n";
+	static const char *warn_msg = "warning: refname '%.*s' is ambiguous.";
$ git tag master
$ bin-wrappers/git rev-parse master
warning: refname 'master' is ambiguous.cfee1ae8f0c56eed7d8ffa821f650789f8b11de2

Here's a fixup.

Signed-off-by: Jonathan Nieder <redacted>
---
diff --git a/sha1_name.c b/sha1_name.c
index d40ae48..823e582 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -342,7 +342,7 @@ static int get_sha1_1(const char *name, int len, unsigned char *sha1);
 
 static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
 {
-	static const char *warn_msg = "warning: refname '%.*s' is ambiguous.";
+	static const char *warn_msg = "warning: refname '%.*s' is ambiguous.\n";
 	char *real_ref = NULL;
 	int refs_found = 0;
 	int at, reflog_len;
-- 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help