Re: [PATCH v2 9/9] sha1_name: add support for @{publish} marks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ramkumar Ramachandra wrote:
> Felipe Contreras wrote:
> > @@ -1068,23 +1069,35 @@ static const char *get_upstream_branch(const char *name_buf, int len)
> >          */
> >         if (!branch)
> >                 die(_("HEAD does not point to a branch"));
> > -       if (!branch->merge || !branch->merge[0]->dst) {
> > -               if (!ref_exists(branch->refname))
> > -                       die(_("No such branch: '%s'"), name);
> > -               if (!branch->merge) {
> > -                       die(_("No upstream configured for branch '%s'"),
> > -                               branch->name);
> > +       switch (type) {
> > +       case 'u':
> > +               if (!branch->merge || !branch->merge[0]->dst) {
> > +                       if (!ref_exists(branch->refname))
> > +                               die(_("No such branch: '%s'"), name);
> > +                       if (!branch->merge) {
> > +                               die(_("No upstream configured for branch '%s'"),
> > +                                       branch->name);
> > +                       }
> > +                       die(
> > +                               _("Upstream branch '%s' not stored as a remote-tracking branch"),
> > +                               branch->merge[0]->src);
> > +               }
> > +               tracking = branch->merge[0]->dst;
> > +               break;
> > +       case 'p':
> > +               if (!branch->push.dst) {
> > +                       die(_("No publish configured for branch '%s'"),
> > +                                       branch->name);
> 
> This assumes a push.default value of 'current' or 'matching'. What
> happens if push.default is set to 'nothing' or 'upstream', for
> instance?

Why would that matter? @{upstream} doesn't depend on this, neither does
@{publish}; @{upstream} is .remote+.merge, @{publish} is .pushremote+.push.

If the user hasn't configured a publish branch, @{publish} fails.

-- 
Felipe Contreras
--
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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]