Merge branch 'jc/maint-1.6.3-graft-trailing-space'
authorJunio C Hamano <gitster@pobox.com>
Sat, 31 Oct 2009 03:07:08 +0000 (20:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 31 Oct 2009 03:07:08 +0000 (20:07 -0700)
* jc/maint-1.6.3-graft-trailing-space:
info/grafts: allow trailing whitespaces at the end of line

commit.c
index fedbd5e5267ec4beaf1f245a879918a2685c10b9..6393e1b36218e5f8970b0c43092b07f5d94b0bce 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -132,8 +132,8 @@ struct commit_graft *read_graft_line(char *buf, int len)
        int i;
        struct commit_graft *graft = NULL;
 
-       if (buf[len-1] == '\n')
-               buf[--len] = 0;
+       while (len && isspace(buf[len-1]))
+               buf[--len] = '\0';
        if (buf[0] == '#' || buf[0] == '\0')
                return NULL;
        if ((len + 1) % 41) {