summaryrefslogtreecommitdiff
path: root/builtin-remote.c
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 /builtin-remote.c
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 'builtin-remote.c')
-rw-r--r--builtin-remote.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin-remote.c b/builtin-remote.c
index a3ee1ac..9d4432b 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -117,6 +117,13 @@ static int add(int argc, const char **argv)
return 1;
}
+ if (mirror) {
+ strbuf_reset(&buf);
+ strbuf_addf(&buf, "remote.%s.mirror", name);
+ if (git_config_set(buf.buf, "yes"))
+ return 1;
+ }
+
if (fetch && fetch_remote(name))
return 1;