summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-28 20:29:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-01-15 18:34:53 (GMT)
commit3f163962282d2d8bea914c32d81ad38544044f78 (patch)
tree4525c22cabc4d4265c4efc18f5768ae5b52ec731 /builtin
parent18814d0e2d7d5924a799bcf0cae3a0aaba569613 (diff)
downloadgit-3f163962282d2d8bea914c32d81ad38544044f78.zip
git-3f163962282d2d8bea914c32d81ad38544044f78.tar.gz
git-3f163962282d2d8bea914c32d81ad38544044f78.tar.bz2
clone/sha1_file: read info/alternates with strbuf_getline()
$GIT_OBJECT_DIRECTORY/info/alternates is a text file that can be edited with a DOS editor. We do not want to use the real path with CR appended at the end. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 29741f4..43b4c99 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -339,7 +339,7 @@ static void copy_alternates(struct strbuf *src, struct strbuf *dst,
FILE *in = fopen(src->buf, "r");
struct strbuf line = STRBUF_INIT;
- while (strbuf_getline_lf(&line, in) != EOF) {
+ while (strbuf_getline(&line, in) != EOF) {
char *abs_path;
if (!line.len || line.buf[0] == '#')
continue;