On Fri, Apr 20, 2012 at 12:57:12AM +0200, Matthieu Moy wrote: > diff --git a/builtin/push.c b/builtin/push.c > index d315475..4602cd8 100644 > --- a/builtin/push.c > +++ b/builtin/push.c > @@ -65,7 +65,17 @@ static void set_refspecs(const char **refs, int nr) > } > } > > -static void setup_push_upstream(struct remote *remote) > +static int push_url_of_remote(struct remote *remote, const char ***url_p) > +{ > + if (remote->pushurl_nr) { > + *url_p = remote->pushurl; > + return remote->pushurl_nr; > + } > + *url_p = remote->url; > + return remote->url_nr; > +} > + Eh, what's this? This wasn't part of my patch. It was part of Junio's patch which mine was based on (and it provokes a "defined but not used" warning when your patch is applied on top of master). > @@ -87,6 +97,35 @@ static void setup_push_upstream(struct remote *remote) > if (branch->merge_nr != 1) > die(_("The current branch %s has multiple upstream branches, " > "refusing to push."), branch->name); > + if (strcmp(branch->remote_name, remote->name)) > + die(_("You are pushing to remote '%s', which is not the upstream of\n" > + "your current branch '%s', without telling me what to push\n" > + "to update which remote branch."), > + remote->name, branch->name); And this was from Junio's patch, which is really a separate topic (that "git push foo" should not respect an upstream branch name when the upstream remote is not "foo"). So I think your rebase turned out a little funny. We probably want to pull in Junio's patch from the tip of jc/push-upstream-sanity (135dade). Though even that can be pared down a little. The push_url_of_remote refactoring was part of an early iteration and does not have to be part of the final version (though I think it is a fine refactoring on its own). > diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh > index b5417cc..f4f9d06 100755 > --- a/t/t5516-fetch-push.sh > +++ b/t/t5516-fetch-push.sh 135dade creates a new t5528 for testing push.default settings, so tests could go there. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html