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

Re: [regression] Re: git-cat-file --batch reversion; cannot query filenames with spaces

From: Jeff King <hidden>
Date: 2016-06-15 22:58:18
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

On Fri, Aug 02, 2013 at 11:30:03AM -0700, Junio C Hamano wrote:
quoted
I didn't see the result of your wrangling in pu, but I will keep an eye
out to double-check it (unless you did not finish, in which case I am
happy to do the wrangling myself).
Here is what is on top of the revert that has been pushed out on
'pu'.
Thanks, that looks good to me.

We may want to also squash in the patch below, which puts the pointer
variable in the most-local block and re-wraps the newly indented comment
for line length. Neither introduced by your adaptation, but they became
more obvious to me when seen on top of the revert.

-Peff

---
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 07b4818..41afaa5 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -286,15 +286,15 @@ static int batch_objects(struct batch_options *opt)
 	warn_on_object_refname_ambiguity = 0;
 
 	while (strbuf_getline(&buf, stdin, '\n') != EOF) {
-		char *p;
 		int error;
 
 		if (data.split_on_whitespace) {
 			/*
-			 * Split at first whitespace, tying off the beginning of the
-			 * string and saving the remainder (or NULL) in data.rest.
+			 * Split at first whitespace, tying off the beginning
+			 * of the string and saving the remainder (or NULL) in
+			 * data.rest.
 			 */
-			p = strpbrk(buf.buf, " \t");
+			char *p = strpbrk(buf.buf, " \t");
 			if (p) {
 				while (*p && strchr(" \t", *p))
 					*p++ = '\0';
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help