diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-10-18 03:11:17 -0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-10-18 03:11:17 -0400 |
commit | e75c55844fd0ff96d00173574b1e49cc472ca928 (patch) | |
tree | 1146c04d598cdb0857e9072e82eee2338f8ee4a4 /t | |
parent | 8f353ee57a2f79697f8dea80ad3174998586bc75 (diff) | |
parent | 1aa3d01f870a68dc46a872c83f9cd051f172f9b3 (diff) | |
download | git-e75c55844fd0ff96d00173574b1e49cc472ca928.tar.gz git-e75c55844fd0ff96d00173574b1e49cc472ca928.tar.xz |
Merge branch 'maint'
* maint:
Yet more 1.5.3.5 fixes mentioned in release notes
cvsserver: Use exit 1 instead of die when req_Root fails.
git-blame shouldn't crash if run in an unmerged tree
git-config: print error message if the config file cannot be read
fixing output of non-fast-forward output of post-receive-email
Diffstat (limited to 't')
-rwxr-xr-x | t/t8004-blame.sh | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/t/t8004-blame.sh b/t/t8004-blame.sh new file mode 100755 index 000000000..ba19ac127 --- /dev/null +++ b/t/t8004-blame.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +# Based on a test case submitted by Björn Steinbrink. + +test_description='git blame on conflicted files' +. ./test-lib.sh + +test_expect_success 'setup first case' ' + # Create the old file + echo "Old line" > file1 && + git add file1 && + git commit --author "Old Line <ol@localhost>" -m file1.a && + + # Branch + git checkout -b foo && + + # Do an ugly move and change + git rm file1 && + echo "New line ..." > file2 && + echo "... and more" >> file2 && + git add file2 && + git commit --author "U Gly <ug@localhost>" -m ugly && + + # Back to master and change something + git checkout master && + echo " + +bla" >> file1 && + git commit --author "Old Line <ol@localhost>" -a -m file1.b && + + # Back to foo and merge master + git checkout foo && + if git merge master; then + echo needed conflict here + exit 1 + else + echo merge failed - resolving automatically + fi && + echo "New line ... +... and more + +bla +Even more" > file2 && + git rm file1 && + git commit --author "M Result <mr@localhost>" -a -m merged && + + # Back to master and change file1 again + git checkout master && + sed s/bla/foo/ <file1 >X && + rm file1 && + mv X file1 && + git commit --author "No Bla <nb@localhost>" -a -m replace && + + # Try to merge into foo again + git checkout foo && + if git merge master; then + echo needed conflict here + exit 1 + else + echo merge failed - test is setup + fi +' + +test_expect_success \ + 'blame runs on unconflicted file while other file has conflicts' ' + git blame file2 +' + +test_expect_success 'blame runs on conflicted file in stages 1,3' ' + git blame file1 +' + +test_done |