contrib/subtree: small tidy-up to test
authorCharles Bailey <cbailey32@bloomberg.net>
Mon, 22 Jun 2015 13:53:30 +0000 (14:53 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Jun 2015 22:30:00 +0000 (15:30 -0700)
There's no need to switch branches to parse another branch's ancestry.

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/t/t7900-subtree.sh
index 001c604dd1093ea678ef4e183a6184f3c3dad2b1..bd3df97936eb77e39642ec917a8d3366945fb0a8 100755 (executable)
@@ -221,9 +221,7 @@ test_expect_success 'check hash of split' '
        spl1=$(git subtree split --prefix subdir) &&
        git subtree split --prefix subdir --branch splitbr1test &&
        check_equal ''"$(git rev-parse splitbr1test)"'' "$spl1" &&
-       git checkout splitbr1test &&
-       new_hash=$(git rev-parse HEAD~2) &&
-       git checkout mainline &&
+       new_hash=$(git rev-parse splitbr1test~2) &&
        check_equal ''"$new_hash"'' "$subdir_hash"
 '