summaryrefslogtreecommitdiff
path: root/t/t5517-push-mirror.sh
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2008-04-17 11:17:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-04-21 01:49:22 (GMT)
commit84bb2dfd9f4873c9ca19537efe62219b09ec03bf (patch)
tree4490819e5489268b9fc9b9eec3da8ec87c8774fa /t/t5517-push-mirror.sh
parent5909ca92d8b2c6a0534597f52f7733ff61a64d63 (diff)
downloadgit-84bb2dfd9f4873c9ca19537efe62219b09ec03bf.zip
git-84bb2dfd9f4873c9ca19537efe62219b09ec03bf.tar.gz
git-84bb2dfd9f4873c9ca19537efe62219b09ec03bf.tar.bz2
Add a remote.*.mirror configuration option
This patch adds a remote.*.mirror configuration option that, when set, automatically puts git-push in --mirror mode for that remote. Furthermore, the option is set automatically by `git remote add --mirror'. The code in remote.c to parse remote.*.skipdefaultupdate had a subtle problem: a comment in the code indicated that special care was needed for boolean options, but this care was not used in parsing the option. Since I was touching related code, I did this fix too. [jc: and I further fixed up the "ignore boolean" code.] Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5517-push-mirror.sh')
-rwxr-xr-xt/t5517-push-mirror.sh41
1 files changed, 40 insertions, 1 deletions
diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh
index ed3fec1..ea49ded 100755
--- a/t/t5517-push-mirror.sh
+++ b/t/t5517-push-mirror.sh
@@ -25,7 +25,7 @@ mk_repo_pair () {
(
cd master &&
git init &&
- git config remote.up.url ../mirror
+ git remote add $1 up ../mirror
)
}
@@ -225,4 +225,43 @@ test_expect_success 'push mirror adds, updates and removes tags together' '
'
+test_expect_success 'remote.foo.mirror adds and removes branches' '
+
+ mk_repo_pair --mirror &&
+ (
+ cd master &&
+ echo one >foo && git add foo && git commit -m one &&
+ git branch keep master &&
+ git branch remove master &&
+ git push up &&
+ git branch -D remove
+ git push up
+ ) &&
+ (
+ cd mirror &&
+ git show-ref -s --verify refs/heads/keep &&
+ invert git show-ref -s --verify refs/heads/remove
+ )
+
+'
+
+test_expect_success 'remote.foo.mirror=no has no effect' '
+
+ mk_repo_pair &&
+ (
+ cd master &&
+ echo one >foo && git add foo && git commit -m one &&
+ git config --add remote.up.mirror no &&
+ git branch keep master &&
+ git push --mirror up &&
+ git branch -D keep &&
+ git push up
+ ) &&
+ (
+ cd mirror &&
+ git show-ref -s --verify refs/heads/keep
+ )
+
+'
+
test_done