summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers/test-bzr.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/remote-helpers/test-bzr.sh')
-rwxr-xr-xcontrib/remote-helpers/test-bzr.sh27
1 files changed, 24 insertions, 3 deletions
diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh
index 5c50251783..4f379c2ab4 100755
--- a/contrib/remote-helpers/test-bzr.sh
+++ b/contrib/remote-helpers/test-bzr.sh
@@ -5,7 +5,8 @@
test_description='Test remote-bzr'
-. ./test-lib.sh
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+. "$TEST_DIRECTORY"/test-lib.sh
if ! test_have_prereq PYTHON
then
@@ -65,13 +66,33 @@ test_expect_success 'pushing' '
test_cmp expected actual
'
+test_expect_success 'forced pushing' '
+ (
+ cd gitrepo &&
+ echo three-new >content &&
+ git commit -a --amend -m three-new &&
+ git push -f
+ ) &&
+
+ (
+ cd bzrrepo &&
+ # the forced update overwrites the bzr branch but not the bzr
+ # working directory (it tries to merge instead)
+ bzr revert
+ ) &&
+
+ echo three-new >expected &&
+ cat bzrrepo/content >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'roundtrip' '
(
cd gitrepo &&
git pull &&
git log --format="%s" -1 origin/master >actual
) &&
- echo three >expected &&
+ echo three-new >expected &&
test_cmp expected actual &&
(cd gitrepo && git push && git pull) &&
@@ -378,7 +399,7 @@ test_expect_success 'export utf-8 authors' '
git add content &&
git commit -m one &&
git remote add bzr "bzr::../bzrrepo" &&
- git push bzr
+ git push bzr master
) &&
(