Subject: [PATCH v3 5/7] notes copy --stdin: read lines with strbuf_getline()

From: Moritz Neeb <[email-masked]>
Date: Sun, 28 Feb 2016 06:13:53 +0100

The format of a line that is expected when copying notes via stdin
is "sha1 sha1". As this is text-only, strbuf_getline() can be used
instead of strbuf_getline_lf().

When reading with strbuf_getline() the trimming can be removed.
It was necessary before to remove potential CRs inserted through
a dos editor.

Signed-off-by: Moritz Neeb <[email-masked]>
---
 builtin/notes.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/builtin/notes.c b/builtin/notes.c
index 22909c7..660c0b7 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -290,12 +290,11 @@ static int notes_copy_from_stdin(int force, const char *rewrite_cmd)
 		t = &default_notes_tree;
 	}
 
-	while (strbuf_getline_lf(&buf, stdin) != EOF) {
+	while (strbuf_getline(&buf, stdin) != EOF) {
 		unsigned char from_obj[20], to_obj[20];
 		struct string_list split = STRING_LIST_INIT_DUP;
 		int err;
 
-		strbuf_rtrim(&buf);
 		string_list_split(&split, buf.buf, ' ', -1);
 
 		if (split.nr != 2)
-- 
2.4.3