diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2008-09-25 09:16:33 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-09-25 09:16:33 -0700 |
commit | 1fa24f8f3d950b17ac15979c09b733c8e6f5c00c (patch) | |
tree | cd2c8c5995a42a407daabd1012d9b46faf180a9b /t | |
parent | 81b84bcbe3cc6a29a62fb1a69c68764ad6c0feeb (diff) | |
parent | 7a172b0dcb9d8ac2311a5c3f674f711476872e71 (diff) | |
download | git-1fa24f8f3d950b17ac15979c09b733c8e6f5c00c.tar.gz git-1fa24f8f3d950b17ac15979c09b733c8e6f5c00c.tar.xz |
Merge branch 'mv/commit-tree'
* mv/commit-tree:
t7603: add new testcases to ensure builtin-commit uses reduce_heads()
builtin-commit: use commit_tree()
commit_tree(): add a new author parameter
Diffstat (limited to 't')
-rwxr-xr-x | t/t7603-merge-reduce-heads.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/t/t7603-merge-reduce-heads.sh b/t/t7603-merge-reduce-heads.sh index b47b7b975..7e17eb490 100755 --- a/t/t7603-merge-reduce-heads.sh +++ b/t/t7603-merge-reduce-heads.sh @@ -60,4 +60,57 @@ test_expect_success 'merge c1 with c2, c3, c4, c5' ' test -f c5.c ' +test_expect_success 'setup' ' + for i in A B C D E + do + echo $i > $i.c && + git add $i.c && + git commit -m $i && + git tag $i + done && + git reset --hard A && + for i in F G H I + do + echo $i > $i.c && + git add $i.c && + git commit -m $i && + git tag $i + done +' + +test_expect_success 'merge E and I' ' + git reset --hard A && + git merge E I +' + +test_expect_success 'verify merge result' ' + test $(git rev-parse HEAD^1) = $(git rev-parse E) && + test $(git rev-parse HEAD^2) = $(git rev-parse I) +' + +test_expect_success 'add conflicts' ' + git reset --hard E && + echo foo > file.c && + git add file.c && + git commit -m E2 && + git tag E2 && + git reset --hard I && + echo bar >file.c && + git add file.c && + git commit -m I2 && + git tag I2 +' + +test_expect_success 'merge E2 and I2, causing a conflict and resolve it' ' + git reset --hard A && + test_must_fail git merge E2 I2 && + echo baz > file.c && + git add file.c && + git commit -m "resolve conflict" +' + +test_expect_success 'verify merge result' ' + test $(git rev-parse HEAD^1) = $(git rev-parse E2) && + test $(git rev-parse HEAD^2) = $(git rev-parse I2) +' test_done |