summaryrefslogtreecommitdiff
path: root/t/t6004-rev-list-path-optim.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-03-23 06:22:07 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-03-23 09:32:26 (GMT)
commitbab36bf57d7a565e0077e1f5d2e3a10afa319ecc (patch)
treeec337696b723d41013f8cc409bff70fbac080b53 /t/t6004-rev-list-path-optim.sh
parent1c4fea3a40e836dcee2f16091bf7bfba96c924d0 (diff)
downloadgit-bab36bf57d7a565e0077e1f5d2e3a10afa319ecc.zip
git-bab36bf57d7a565e0077e1f5d2e3a10afa319ecc.tar.gz
git-bab36bf57d7a565e0077e1f5d2e3a10afa319ecc.tar.bz2
t6004: add a bit more path optimization test.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t6004-rev-list-path-optim.sh')
-rwxr-xr-xt/t6004-rev-list-path-optim.sh34
1 files changed, 33 insertions, 1 deletions
diff --git a/t/t6004-rev-list-path-optim.sh b/t/t6004-rev-list-path-optim.sh
index 5182dbb..761f09b 100755
--- a/t/t6004-rev-list-path-optim.sh
+++ b/t/t6004-rev-list-path-optim.sh
@@ -7,7 +7,8 @@ test_description='git-rev-list trivial path optimization test'
test_expect_success setup '
echo Hello > a &&
git add a &&
-git commit -m "Initial commit" a
+git commit -m "Initial commit" a &&
+initial=$(git rev-parse --verify HEAD)
'
test_expect_success path-optimization '
@@ -16,4 +17,35 @@ test_expect_success path-optimization '
test $(git-rev-list $commit -- . | wc -l) = 1
'
+test_expect_success 'further setup' '
+ git checkout -b side &&
+ echo Irrelevant >c &&
+ git add c &&
+ git commit -m "Side makes an irrelevant commit" &&
+ echo "More Irrelevancy" >c &&
+ git add c &&
+ git commit -m "Side makes another irrelevant commit" &&
+ echo Bye >a &&
+ git add a &&
+ git commit -m "Side touches a" &&
+ side=$(git rev-parse --verify HEAD) &&
+ echo "Yet more Irrelevancy" >c &&
+ git add c &&
+ git commit -m "Side makes yet another irrelevant commit" &&
+ git checkout master &&
+ echo Another >b &&
+ git add b &&
+ git commit -m "Master touches b" &&
+ git merge side &&
+ echo Touched >b &&
+ git add b &&
+ git commit -m "Master touches b again"
+'
+
+test_expect_success 'path optimization 2' '
+ ( echo "$side"; echo "$initial" ) >expected &&
+ git rev-list HEAD -- a >actual &&
+ diff -u expected actual
+'
+
test_done