Skip to content

Commit 99d0030

Browse files
committed
credentials: make line reading Windows compatible
This commit makes reading process regarding credentials compatible with 'CR/LF' line ending. It makes using git more convenient on systems like Windows.
1 parent 2a9cc71 commit 99d0030

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

credential-cache--daemon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ static int read_request(FILE *fh, struct credential *c,
9696
static struct strbuf item = STRBUF_INIT;
9797
const char *p;
9898

99-
strbuf_getline_lf(&item, fh);
99+
strbuf_getline(&item, fh);
100100
if (!skip_prefix(item.buf, "action=", &p))
101101
return error("client sent bogus action line: %s", item.buf);
102102
strbuf_addstr(action, p);
103103

104-
strbuf_getline_lf(&item, fh);
104+
strbuf_getline(&item, fh);
105105
if (!skip_prefix(item.buf, "timeout=", &p))
106106
return error("client sent bogus timeout line: %s", item.buf);
107107
*timeout = atoi(p);

credential-store.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static int parse_credential_file(const char *fn,
2323
return found_credential;
2424
}
2525

26-
while (strbuf_getline_lf(&line, fh) != EOF) {
26+
while (strbuf_getline(&line, fh) != EOF) {
2727
credential_from_url(&entry, line.buf);
2828
if (entry.username && entry.password &&
2929
credential_match(c, &entry)) {

0 commit comments

Comments
 (0)