Re: [PATCH v5 12/27] refs: forbid cross-backend ref renames

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

 



On Sat, 2016-02-20 at 11:30 +0700, Duy Nguyen wrote:
> On Thu, Feb 18, 2016 at 12:17 PM, David Turner <
> dturner@xxxxxxxxxxxxxxxx> wrote:
> > This would be pretty weird, but since it will break, we should
> > prevent
> > it.
> > 
> > Signed-off-by: David Turner <dturner@xxxxxxxxxxxxxxxx>
> > ---
> >  refs.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/refs.c b/refs.c
> > index f5754f2..8eb04da 100644
> > --- a/refs.c
> > +++ b/refs.c
> > @@ -1306,5 +1306,11 @@ int delete_refs(struct string_list
> > *refnames)
> > 
> >  int rename_ref(const char *oldref, const char *newref, const char
> > *logmsg)
> >  {
> > +       if ((ref_type(oldref) == REF_TYPE_NORMAL) !=
> > +           (ref_type(newref) == REF_TYPE_NORMAL)) {
> > +               error(_("Both ref arguments to rename_ref must be
> > normal "
> > +                       "(or both must be per
> > -worktree/pseudorefs)"));
> > +               return -1;
> 
> You can do return error(...);
> 
> > +       }
> >         return the_refs_backend->rename_ref(oldref, newref,
> > logmsg);
> 
> LMDB backend can't deal with per-worktree rename. So either forbid
> per-worktree rename here too, or fall back to files backend.

Will do, thanks.
--
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]