diff options
-rw-r--r-- | Documentation/git-remote.txt | 4 | ||||
-rw-r--r-- | builtin/remote.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt index 79e38fedd7..ddcbcc00ae 100644 --- a/Documentation/git-remote.txt +++ b/Documentation/git-remote.txt @@ -75,10 +75,6 @@ because a fetch would overwrite any local commits. + When a push mirror is created with `\--mirror=push`, then `git push` will always behave as if `\--mirror` was passed. -+ -The option `\--mirror` (with no type) sets up both push and fetch -mirror configuration. It is kept for historical purposes, and is -probably not what you want. 'rename':: diff --git a/builtin/remote.c b/builtin/remote.c index f9522d5d8b..eb1229d689 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -136,13 +136,19 @@ static int add_branch(const char *key, const char *branchname, return git_config_set_multivar(key, tmp->buf, "^$", 0); } +static const char mirror_advice[] = +"--mirror is dangerous and deprecated; please\n" +"\t use --mirror=fetch or --mirror=push instead"; + static int parse_mirror_opt(const struct option *opt, const char *arg, int not) { unsigned *mirror = opt->value; if (not) *mirror = MIRROR_NONE; - else if (!arg) + else if (!arg) { + warning("%s", mirror_advice); *mirror = MIRROR_BOTH; + } else if (!strcmp(arg, "fetch")) *mirror = MIRROR_FETCH; else if (!strcmp(arg, "push")) |