[PATCH v2 5/6] remote: read $GIT_DIR/branches/* with strbuf_getline()
- From
- Moritz Neeb <lists@moritzneeb.de>
- Date
- Feb 22, 2016, 01:22 UTC
- Message-ID
- <56CA62D3.7060808@moritzneeb.de>
- In-Reply-To
- <56CA5DBB.8040006@moritzneeb.de>
The line read from the branch file is directly trimmed after reading with strbuf_trim(). There is thus no logic expecting CR, so strbuf_getline_lf() can be replaced by its CRLF counterpart.
Signed-off-by: Moritz Neeb <lists@moritzneeb.de> --- To be honest, I did not yet fully understand the purpose of this branches/ file. What I'd expect is that it is some intermediary file while fetching? Or is it edited directly by the user and thus it's necessary to strip spaces that could be added accidentally?
remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/remote.c b/remote.c index 02e698a..aaff6aa 100644 --- a/remote.c +++ b/remote.c @@ -281,7 +281,7 @@ static void read_branches_file(struct remote *remote) if (!f) return; - strbuf_getline_lf(&buf, f); + strbuf_getline(&buf, f); fclose(f); strbuf_trim(&buf); if (!buf.len) {
-- 2.7.1.345.gc14003e