test_expect_success 'push with insteadOf' '
mk_empty &&
TRASH="$(pwd)/" &&
- git config "url./$TRASH/.insteadOf" trash/ &&
+ git config "url.$TRASH.insteadOf" trash/ &&
git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
(
cd testrepo &&
mk_test heads/master &&
git push testrepo : &&
git commit --amend -massaged &&
- ! git push testrepo &&
+ test_must_fail git push testrepo &&
check_push_result $the_commit heads/master &&
git reset --hard $the_commit
# Without force rewinding should fail
git reset --hard HEAD^ &&
- ! git push testrepo HEAD &&
+ test_must_fail git push testrepo HEAD &&
check_push_result $the_commit heads/local &&
# With force rewinding should succeed
git clone parent child &&
(cd child &&
echo two >foo && git commit -a -m two &&
- ! git push &&
+ test_must_fail git push &&
test $(git rev-parse master) != \
$(git rev-parse remotes/origin/master))
pwd &&
rm -f testrepo/.git/objects/??/* &&
git push testrepo :refs/heads/master &&
- (cd testrepo && ! git rev-parse --verify refs/heads/master)
+ (cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)
'