summaryrefslogtreecommitdiff
path: root/t/t5533-push-cas.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5533-push-cas.sh')
-rwxr-xr-xt/t5533-push-cas.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh
index d38ecee217..4269058c89 100755
--- a/t/t5533-push-cas.sh
+++ b/t/t5533-push-cas.sh
@@ -17,7 +17,8 @@ test_expect_success setup '
# create template repository
test_commit A &&
test_commit B &&
- test_commit C
+ test_commit C &&
+ git config --global push.allowLazyForceWithLease true
'
test_expect_success 'push to update (protected)' '
@@ -91,6 +92,7 @@ test_expect_success 'push to update (allowed)' '
(
cd dst &&
test_commit D &&
+ git config push.allowLazyForceWithLease false &&
git push --force-with-lease=master:master^ origin master
) &&
git ls-remote dst refs/heads/master >expect &&
@@ -103,6 +105,10 @@ test_expect_success 'push to update (allowed, tracking)' '
(
cd dst &&
test_commit D &&
+ git config push.allowLazyForceWithLease false &&
+ test_must_fail git push --force-with-lease=master origin master 2>err &&
+ grep "lazy force-with-lease" err &&
+ git config --unset push.allowLazyForceWithLease &&
git push --force-with-lease=master origin master 2>err &&
! grep "forced update" err
) &&
@@ -151,6 +157,10 @@ test_expect_success 'push to delete (allowed)' '
setup_srcdst_basic &&
(
cd dst &&
+ git config push.allowLazyForceWithLease false &&
+ test_must_fail git push --force-with-lease=master origin :master 2>err &&
+ grep "lazy force-with-lease" err &&
+ git config --unset push.allowLazyForceWithLease &&
git push --force-with-lease=master origin :master 2>err &&
grep deleted err
) &&
@@ -183,6 +193,9 @@ test_expect_success 'cover everything with default force-with-lease (allowed)' '
(
cd dst &&
git fetch &&
+ git config push.allowLazyForceWithLease false &&
+ test_must_fail git push --force-with-lease origin master master:naster &&
+ git config --unset push.allowLazyForceWithLease &&
git push --force-with-lease origin master master:naster
) &&
git ls-remote dst refs/heads/master |
@@ -196,6 +209,9 @@ test_expect_success 'new branch covered by force-with-lease' '
(
cd dst &&
git branch branch master &&
+ git config push.allowLazyForceWithLease false &&
+ test_must_fail git push --force-with-lease=branch origin branch &&
+ git config --unset push.allowLazyForceWithLease &&
git push --force-with-lease=branch origin branch
) &&
git ls-remote dst refs/heads/branch >expect &&