]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Merge branch 'kb/maint-status-cquote'
authorJunio C Hamano <gitster@pobox.com>
Sat, 4 Dec 2010 00:13:06 +0000 (16:13 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 4 Dec 2010 00:13:06 +0000 (16:13 -0800)
* kb/maint-status-cquote:
  status: Quote paths with spaces in short format

1  2 
wt-status.c

diff --combined wt-status.c
index d9f3d9fe9369ceaac07f5b405e25cf94d824e102,9624865e21739139a9fef5ebc31196cbcd22011a..06ae161c6707e893ab723812b268016a05b950fe
@@@ -88,7 -88,7 +88,7 @@@ static void wt_status_print_dirty_heade
  {
        const char *c = color(WT_STATUS_HEADER, s);
  
 -      color_fprintf_ln(s->fp, c, "# Changed but not updated:");
 +      color_fprintf_ln(s->fp, c, "# Changes not staged for commit:");
        if (!advice_status_hints)
                return;
        if (!has_deleted)
@@@ -744,10 -744,20 +744,20 @@@ static void wt_shortstatus_status(int n
                const char *one;
                if (d->head_path) {
                        one = quote_path(d->head_path, -1, &onebuf, s->prefix);
+                       if (*one != '"' && strchr(one, ' ') != NULL) {
+                               putchar('"');
+                               strbuf_addch(&onebuf, '"');
+                               one = onebuf.buf;
+                       }
                        printf("%s -> ", one);
                        strbuf_release(&onebuf);
                }
                one = quote_path(it->string, -1, &onebuf, s->prefix);
+               if (*one != '"' && strchr(one, ' ') != NULL) {
+                       putchar('"');
+                       strbuf_addch(&onebuf, '"');
+                       one = onebuf.buf;
+               }
                printf("%s\n", one);
                strbuf_release(&onebuf);
        }