summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ignore.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ignore.c b/src/ignore.c
index f089dbeb5..615cd94bf 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -213,6 +213,16 @@ static int parse_ignore_file(
if (ignore_case)
match->flags |= GIT_ATTR_FNMATCH_ICASE;
+ while (match->length > 0) {
+ if (match->pattern[match->length - 1] == ' ' ||
+ match->pattern[match->length - 1] == '\t') {
+ match->pattern[match->length - 1] = 0;
+ match->length --;
+ } else {
+ break;
+ }
+ }
+
scan = git__next_line(scan);
/*