[PATCH v3 7/7] wt-status: read rebase todolist with strbuf_getline()
- From
- Moritz Neeb <lists@moritzneeb.de>
- Date
- Feb 28, 2016, 05:14 UTC
- Message-ID
- <56D28224.9010005@moritzneeb.de>
- In-Reply-To
- <56D28092.9090209@moritzneeb.de>
In read_rebase_todolist() the files $GIT_DIR/rebase-merge/done and $GIT_DIR/rebase-merge/git-rebase-todo are read to collect status information.
The access to this file should always happen via git rebase, e.g. via "git rebase -i" or "git rebase --edit-todo". We can assume, that this interface handles the preprocessing of whitespaces, especially CRLFs correctly. Thus in this codepath we can remove the call to strbuf_trim().
For documenting the input as expecting "text" input, strbuf_getline_lf() is still replaced by strbuf_getline().
Signed-off-by: Moritz Neeb <lists@moritzneeb.de> --- wt-status.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/wt-status.c b/wt-status.c index ab4f80d..8047cf2 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1076,10 +1076,9 @@ static void read_rebase_todolist(const char *fname, struct string_list *lines) if (!f) die_errno("Could not open file %s for reading", git_path("%s", fname)); - while (!strbuf_getline_lf(&line, f)) { + while (!strbuf_getline(&line, f)) { if (line.len && line.buf[0] == comment_line_char) continue; - strbuf_trim(&line); if (!line.len) continue; abbrev_sha1_in_line(&line);
-- 2.4.3