diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-09-27 00:52:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-09-27 00:52:47 -0700 |
commit | a17ba31b0b75365e1245e494d46abae4afc57480 (patch) | |
tree | 41c1d800c92e60d97a8b984dce086bcb3473dcc2 /builtin-ls-files.c | |
parent | 0f729f21348c43a1c80f48faed2e753b1c923e85 (diff) | |
parent | 6d69b6f6ac27ab6f71a10da34b813ca25fd2a358 (diff) | |
download | git-a17ba31b0b75365e1245e494d46abae4afc57480.tar.gz git-a17ba31b0b75365e1245e494d46abae4afc57480.tar.xz |
Merge branch 'ph/strbuf' into kh/commit
* ph/strbuf:
Clean up stripspace a bit, use strbuf even more.
Add strbuf_read_file().
rerere: Fix use of an empty strbuf.buf
Small cache_tree_write refactor.
Make builtin-rerere use of strbuf nicer and more efficient.
Add strbuf_cmp.
strbuf_setlen(): do not barf on setting length of an empty buffer to 0
sq_quote_argv and add_to_string rework with strbuf's.
Full rework of quote_c_style and write_name_quoted.
Rework unquote_c_style to work on a strbuf.
strbuf API additions and enhancements.
nfv?asprintf are broken without va_copy, workaround them.
Fix the expansion pattern of the pseudo-static path buffer.
Diffstat (limited to 'builtin-ls-files.c')
-rw-r--r-- | builtin-ls-files.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 48dd3f77a..2e6f43bb9 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -84,8 +84,7 @@ static void show_dir_entry(const char *tag, struct dir_entry *ent) return; fputs(tag, stdout); - write_name_quoted("", 0, ent->name + offset, line_terminator, stdout); - putchar(line_terminator); + write_name_quoted(ent->name + offset, stdout, line_terminator); } static void show_other_files(struct dir_struct *dir) @@ -208,21 +207,15 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce) if (!show_stage) { fputs(tag, stdout); - write_name_quoted("", 0, ce->name + offset, - line_terminator, stdout); - putchar(line_terminator); - } - else { + } else { printf("%s%06o %s %d\t", tag, ntohl(ce->ce_mode), abbrev ? find_unique_abbrev(ce->sha1,abbrev) : sha1_to_hex(ce->sha1), ce_stage(ce)); - write_name_quoted("", 0, ce->name + offset, - line_terminator, stdout); - putchar(line_terminator); } + write_name_quoted(ce->name + offset, stdout, line_terminator); } static void show_files(struct dir_struct *dir, const char *prefix) |