author | Junio C Hamano <gitster@pobox.com> | |
Fri, 17 Oct 2008 08:52:32 +0000 (01:52 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 17 Oct 2008 08:52:32 +0000 (01:52 -0700) |
* 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
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
1 | 2 | |||
---|---|---|---|---|
remote.c | patch | | diff1 | | diff2 | | blob | history |
t/t4018-diff-funcname.sh | patch | | diff1 | | diff2 | | blob | history |
t/t7600-merge.sh | patch | | diff1 | | diff2 | | blob | history |
xdiff-interface.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc remote.c
Simple merge
diff --cc t/t4018-diff-funcname.sh
Simple merge
diff --cc t/t7600-merge.sh
index 7313ac278cb7cb1d741e49f261e65d929ddeffb7,5abce3119bb2d0c0379b28d40b4919b8b0de0171..3a36a95b9ac42b35e680109df4daf87fc219fb53
--- 1/t/t7600-merge.sh
--- 2/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
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 <<EOF
+ Merge branch 'c5' (early part)
+ EOF
+
+ test_expect_success 'merge early part of c2' '
+ git reset --hard c3 &&
+ echo c4 > 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 f3f6db3297e4fd367d7af05a4755037aaf2aaf42,3bf83f81e38d4a4cc114f3c577241cf7b9eddc7e..49e06af710ceee5538eb10f0c6cf9c30f31748b4
--- 1/xdiff-interface.c
--- 2/xdiff-interface.c
+++ b/xdiff-interface.c
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