From: Junio C Hamano Date: Fri, 17 Oct 2008 08:52:32 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.6.1-rc1~144 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=46dc1b0e332612aa32c139007fa33f4b429de9d1;p=git.git Merge branch 'maint' * maint: t1301-shared-repo.sh: don't let a default ACL interfere with the test git-check-attr(1): add output and example sections xdiff-interface.c: strip newline (and cr) from line before pattern matching t4018-diff-funcname: demonstrate end of line funcname matching flaw t4018-diff-funcname: rework negated last expression test Typo "does not exists" when git remote update remote. remote.c: correct the check for a leading '/' in a remote name Add testcase to ensure merging an early part of a branch is done properly Conflicts: t/t7600-merge.sh --- 46dc1b0e332612aa32c139007fa33f4b429de9d1 diff --cc t/t7600-merge.sh index 7313ac278,5abce3119..3a36a95b9 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@@ -511,13 -507,30 +511,37 @@@ test_expect_success 'in-index merge' test_debug 'gitk --all' +test_expect_success 'refresh the index before merging' ' + git reset --hard c1 && + sleep 1 && + touch file && + git merge c3 +' + + cat >expected < c4.c && + git add c4.c && + git commit -m c4 && + git tag c4 && + echo c5 > c5.c && + git add c5.c && + git commit -m c5 && + git tag c5 && + git reset --hard c3 && + echo c6 > c6.c && + git add c6.c && + git commit -m c6 && + git tag c6 && + git merge c5~1 && + git show -s --pretty=format:%s HEAD > actual && + test_cmp actual expected + ' + test_debug 'gitk --all' test_done diff --cc xdiff-interface.c index f3f6db329,3bf83f81e..49e06af71 --- a/xdiff-interface.c +++ b/xdiff-interface.c @@@ -194,11 -182,10 +194,21 @@@ static long ff_regexp(const char *line char *line_buffer; struct ff_regs *regs = priv; regmatch_t pmatch[2]; - int result = 0, i; + int i; + int result = -1; + + /* Exclude terminating newline (and cr) from matching */ + if (len > 0 && line[len-1] == '\n') { ++ if (len > 1 && line[len-2] == '\r') ++ len -= 2; ++ else ++ len--; ++ } ++ ++ line_buffer = xstrndup(line, len); /* make NUL terminated */ + + /* Exclude terminating newline (and cr) from matching */ + if (len > 0 && line[len-1] == '\n') { if (len > 1 && line[len-2] == '\r') len -= 2; else