summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c4fea3)
raw | patch | inline | side by side (parent: 1c4fea3)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 23 Mar 2007 06:22:07 +0000 (23:22 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 23 Mar 2007 09:32:26 +0000 (02:32 -0700) |
Signed-off-by: Junio C Hamano <junkio@cox.net>
t/t6004-rev-list-path-optim.sh | patch | blob | history |
index 5182dbb15811ae518c1686c0a8f037a84d3cbd06..761f09b1e537ebf9c24171c646e8578d99ce95fa 100755 (executable)
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 '
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