]> git.ipfire.org Git - thirdparty/git.git/commitdiff
push tests: fix logic error in "push" test assertion
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 31 Jul 2018 13:07:11 +0000 (13:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 Jul 2018 16:25:25 +0000 (09:25 -0700)
Fix a logic error that's been here since this test was added in
dbfeddb12e ("push: require force for refs under refs/tags/",
2012-11-29).

The intent of this test is to force-create a new tag pointing to
HEAD~, and then assert that pushing it doesn't work without --force.

Instead, the code was not creating a new tag at all, and then failing
to push the previous tag for the unrelated reason of providing a
refspec that doesn't make any sense.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5516-fetch-push.sh

index 4d487d687575da9839b8874f971dbe4b74f3e1fb..82af990ab348ce883ccaa0da627117e9ce0e138b 100755 (executable)
@@ -979,8 +979,8 @@ test_expect_success 'push requires --force to update lightweight tag' '
                git tag -f testTag &&
                test_must_fail git push ../child2 testTag &&
                git push --force ../child2 testTag &&
-               git tag -f testTag &&
-               test_must_fail git push ../child2 testTag HEAD~ &&
+               git tag -f testTag HEAD~ &&
+               test_must_fail git push ../child2 testTag &&
                git push --force ../child2 testTag
        )
 '