t800?-blame.sh: retitle uniquely
authorMichael J Gruber <git@drmicha.warpmail.net>
Mon, 13 Dec 2010 16:12:29 +0000 (17:12 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Dec 2010 19:54:39 +0000 (11:54 -0800)
Currently we have three test files matching t800?-blame.sh.

Rename the latter two to make it easier to spot where additions would
go.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t8003-blame-corner-cases.sh [new file with mode: 0755]
t/t8003-blame.sh [deleted file]
t/t8004-blame-with-conflicts.sh [new file with mode: 0755]
t/t8004-blame.sh [deleted file]
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
new file mode 100755 (executable)
index 0000000..230143c
--- /dev/null
@@ -0,0 +1,188 @@
+#!/bin/sh
+
+test_description='git blame corner cases'
+. ./test-lib.sh
+
+pick_fc='s/^[0-9a-f^]* *\([^ ]*\) *(\([^ ]*\) .*/\1-\2/'
+
+test_expect_success setup '
+
+       echo A A A A A >one &&
+       echo B B B B B >two &&
+       echo C C C C C >tres &&
+       echo ABC >mouse &&
+       for i in 1 2 3 4 5 6 7 8 9
+       do
+               echo $i
+       done >nine_lines &&
+       for i in 1 2 3 4 5 6 7 8 9 a
+       do
+               echo $i
+       done >ten_lines &&
+       git add one two tres mouse nine_lines ten_lines &&
+       test_tick &&
+       GIT_AUTHOR_NAME=Initial git commit -m Initial &&
+
+       cat one >uno &&
+       mv two dos &&
+       cat one >>tres &&
+       echo DEF >>mouse
+       git add uno dos tres mouse &&
+       test_tick &&
+       GIT_AUTHOR_NAME=Second git commit -a -m Second &&
+
+       echo GHIJK >>mouse &&
+       git add mouse &&
+       test_tick &&
+       GIT_AUTHOR_NAME=Third git commit -m Third &&
+
+       cat mouse >cow &&
+       git add cow &&
+       test_tick &&
+       GIT_AUTHOR_NAME=Fourth git commit -m Fourth &&
+
+       {
+               echo ABC
+               echo DEF
+               echo XXXX
+               echo GHIJK
+       } >cow &&
+       git add cow &&
+       test_tick &&
+       GIT_AUTHOR_NAME=Fifth git commit -m Fifth
+'
+
+test_expect_success 'straight copy without -C' '
+
+       git blame uno | grep Second
+
+'
+
+test_expect_success 'straight move without -C' '
+
+       git blame dos | grep Initial
+
+'
+
+test_expect_success 'straight copy with -C' '
+
+       git blame -C1 uno | grep Second
+
+'
+
+test_expect_success 'straight move with -C' '
+
+       git blame -C1 dos | grep Initial
+
+'
+
+test_expect_success 'straight copy with -C -C' '
+
+       git blame -C -C1 uno | grep Initial
+
+'
+
+test_expect_success 'straight move with -C -C' '
+
+       git blame -C -C1 dos | grep Initial
+
+'
+
+test_expect_success 'append without -C' '
+
+       git blame -L2 tres | grep Second
+
+'
+
+test_expect_success 'append with -C' '
+
+       git blame -L2 -C1 tres | grep Second
+
+'
+
+test_expect_success 'append with -C -C' '
+
+       git blame -L2 -C -C1 tres | grep Second
+
+'
+
+test_expect_success 'append with -C -C -C' '
+
+       git blame -L2 -C -C -C1 tres | grep Initial
+
+'
+
+test_expect_success 'blame wholesale copy' '
+
+       git blame -f -C -C1 HEAD^ -- cow | sed -e "$pick_fc" >current &&
+       {
+               echo mouse-Initial
+               echo mouse-Second
+               echo mouse-Third
+       } >expected &&
+       test_cmp expected current
+
+'
+
+test_expect_success 'blame wholesale copy and more' '
+
+       git blame -f -C -C1 HEAD -- cow | sed -e "$pick_fc" >current &&
+       {
+               echo mouse-Initial
+               echo mouse-Second
+               echo cow-Fifth
+               echo mouse-Third
+       } >expected &&
+       test_cmp expected current
+
+'
+
+test_expect_success 'blame path that used to be a directory' '
+       mkdir path &&
+       echo A A A A A >path/file &&
+       echo B B B B B >path/elif &&
+       git add path &&
+       test_tick &&
+       git commit -m "path was a directory" &&
+       rm -fr path &&
+       echo A A A A A >path &&
+       git add path &&
+       test_tick &&
+       git commit -m "path is a regular file" &&
+       git blame HEAD^.. -- path
+'
+
+test_expect_success 'blame to a commit with no author name' '
+  TREE=`git rev-parse HEAD:`
+  cat >badcommit <<EOF
+tree $TREE
+author <noname> 1234567890 +0000
+committer David Reiss <dreiss@facebook.com> 1234567890 +0000
+
+some message
+EOF
+  COMMIT=`git hash-object -t commit -w badcommit`
+  git --no-pager blame $COMMIT -- uno >/dev/null
+'
+
+test_expect_success 'blame -L with invalid start' '
+       test_must_fail git blame -L5 tres 2>errors &&
+       grep "has only 2 lines" errors
+'
+
+test_expect_success 'blame -L with invalid end' '
+       test_must_fail git blame -L1,5 tres 2>errors &&
+       grep "has only 2 lines" errors
+'
+
+test_expect_success 'indent of line numbers, nine lines' '
+       git blame nine_lines >actual &&
+       test $(grep -c "  " actual) = 0
+'
+
+test_expect_success 'indent of line numbers, ten lines' '
+       git blame ten_lines >actual &&
+       test $(grep -c "  " actual) = 9
+'
+
+test_done
diff --git a/t/t8003-blame.sh b/t/t8003-blame.sh
deleted file mode 100755 (executable)
index 230143c..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-#!/bin/sh
-
-test_description='git blame corner cases'
-. ./test-lib.sh
-
-pick_fc='s/^[0-9a-f^]* *\([^ ]*\) *(\([^ ]*\) .*/\1-\2/'
-
-test_expect_success setup '
-
-       echo A A A A A >one &&
-       echo B B B B B >two &&
-       echo C C C C C >tres &&
-       echo ABC >mouse &&
-       for i in 1 2 3 4 5 6 7 8 9
-       do
-               echo $i
-       done >nine_lines &&
-       for i in 1 2 3 4 5 6 7 8 9 a
-       do
-               echo $i
-       done >ten_lines &&
-       git add one two tres mouse nine_lines ten_lines &&
-       test_tick &&
-       GIT_AUTHOR_NAME=Initial git commit -m Initial &&
-
-       cat one >uno &&
-       mv two dos &&
-       cat one >>tres &&
-       echo DEF >>mouse
-       git add uno dos tres mouse &&
-       test_tick &&
-       GIT_AUTHOR_NAME=Second git commit -a -m Second &&
-
-       echo GHIJK >>mouse &&
-       git add mouse &&
-       test_tick &&
-       GIT_AUTHOR_NAME=Third git commit -m Third &&
-
-       cat mouse >cow &&
-       git add cow &&
-       test_tick &&
-       GIT_AUTHOR_NAME=Fourth git commit -m Fourth &&
-
-       {
-               echo ABC
-               echo DEF
-               echo XXXX
-               echo GHIJK
-       } >cow &&
-       git add cow &&
-       test_tick &&
-       GIT_AUTHOR_NAME=Fifth git commit -m Fifth
-'
-
-test_expect_success 'straight copy without -C' '
-
-       git blame uno | grep Second
-
-'
-
-test_expect_success 'straight move without -C' '
-
-       git blame dos | grep Initial
-
-'
-
-test_expect_success 'straight copy with -C' '
-
-       git blame -C1 uno | grep Second
-
-'
-
-test_expect_success 'straight move with -C' '
-
-       git blame -C1 dos | grep Initial
-
-'
-
-test_expect_success 'straight copy with -C -C' '
-
-       git blame -C -C1 uno | grep Initial
-
-'
-
-test_expect_success 'straight move with -C -C' '
-
-       git blame -C -C1 dos | grep Initial
-
-'
-
-test_expect_success 'append without -C' '
-
-       git blame -L2 tres | grep Second
-
-'
-
-test_expect_success 'append with -C' '
-
-       git blame -L2 -C1 tres | grep Second
-
-'
-
-test_expect_success 'append with -C -C' '
-
-       git blame -L2 -C -C1 tres | grep Second
-
-'
-
-test_expect_success 'append with -C -C -C' '
-
-       git blame -L2 -C -C -C1 tres | grep Initial
-
-'
-
-test_expect_success 'blame wholesale copy' '
-
-       git blame -f -C -C1 HEAD^ -- cow | sed -e "$pick_fc" >current &&
-       {
-               echo mouse-Initial
-               echo mouse-Second
-               echo mouse-Third
-       } >expected &&
-       test_cmp expected current
-
-'
-
-test_expect_success 'blame wholesale copy and more' '
-
-       git blame -f -C -C1 HEAD -- cow | sed -e "$pick_fc" >current &&
-       {
-               echo mouse-Initial
-               echo mouse-Second
-               echo cow-Fifth
-               echo mouse-Third
-       } >expected &&
-       test_cmp expected current
-
-'
-
-test_expect_success 'blame path that used to be a directory' '
-       mkdir path &&
-       echo A A A A A >path/file &&
-       echo B B B B B >path/elif &&
-       git add path &&
-       test_tick &&
-       git commit -m "path was a directory" &&
-       rm -fr path &&
-       echo A A A A A >path &&
-       git add path &&
-       test_tick &&
-       git commit -m "path is a regular file" &&
-       git blame HEAD^.. -- path
-'
-
-test_expect_success 'blame to a commit with no author name' '
-  TREE=`git rev-parse HEAD:`
-  cat >badcommit <<EOF
-tree $TREE
-author <noname> 1234567890 +0000
-committer David Reiss <dreiss@facebook.com> 1234567890 +0000
-
-some message
-EOF
-  COMMIT=`git hash-object -t commit -w badcommit`
-  git --no-pager blame $COMMIT -- uno >/dev/null
-'
-
-test_expect_success 'blame -L with invalid start' '
-       test_must_fail git blame -L5 tres 2>errors &&
-       grep "has only 2 lines" errors
-'
-
-test_expect_success 'blame -L with invalid end' '
-       test_must_fail git blame -L1,5 tres 2>errors &&
-       grep "has only 2 lines" errors
-'
-
-test_expect_success 'indent of line numbers, nine lines' '
-       git blame nine_lines >actual &&
-       test $(grep -c "  " actual) = 0
-'
-
-test_expect_success 'indent of line numbers, ten lines' '
-       git blame ten_lines >actual &&
-       test $(grep -c "  " actual) = 9
-'
-
-test_done
diff --git a/t/t8004-blame-with-conflicts.sh b/t/t8004-blame-with-conflicts.sh
new file mode 100755 (executable)
index 0000000..ba19ac1
--- /dev/null
@@ -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
diff --git a/t/t8004-blame.sh b/t/t8004-blame.sh
deleted file mode 100755 (executable)
index ba19ac1..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/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