mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
info/grafts: allow trailing whitespaces at the end of line
When creating an info/grafts under windows, one typically gets a CRLF file. There is no good reason to forbid trailing CR at the end of the line (for that matter, any trailing whitespaces); the code allowed only LF simply because that was good enough for the platforms with LF line endings. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ba7e81430a
commit
fe0a3cb23c
4
commit.c
4
commit.c
|
@ -136,8 +136,8 @@ struct commit_graft *read_graft_line(char *buf, int len)
|
||||||
int i;
|
int i;
|
||||||
struct commit_graft *graft = NULL;
|
struct commit_graft *graft = NULL;
|
||||||
|
|
||||||
if (buf[len-1] == '\n')
|
while (len && isspace(buf[len-1]))
|
||||||
buf[--len] = 0;
|
buf[--len] = '\0';
|
||||||
if (buf[0] == '#' || buf[0] == '\0')
|
if (buf[0] == '#' || buf[0] == '\0')
|
||||||
return NULL;
|
return NULL;
|
||||||
if ((len + 1) % 41) {
|
if ((len + 1) % 41) {
|
||||||
|
|
Loading…
Reference in a new issue