Re: [PATCH v5 1/7] reset: do not accept a mixed reset in a .git dir

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

 



Christian Couder <chriscool@xxxxxxxxxxxxx> writes:

> diff --git a/builtin-reset.c b/builtin-reset.c
> index 11d1c6e..ac3505b 100644
> --- a/builtin-reset.c
> +++ b/builtin-reset.c
> @@ -286,11 +286,15 @@ int cmd_reset(int argc, const char **argv, const char 
> *pre
>         if (reset_type == NONE)
>                 reset_type = MIXED; /* by default */
>
> -       if ((reset_type == HARD || reset_type == MERGE)
> -           && !is_inside_work_tree())
> +       if (reset_type != SOFT && reset_type != MIXED
> +            && !is_inside_work_tree())
>                 die("%s reset requires a work tree",
>                     reset_type_names[reset_type]);
>
> +       if (reset_type == MIXED && is_bare_repository())
> +               die("%s reset is not allowed in a bare repository",
> +                   reset_type_names[reset_type]);

This patch text itself makes sense, I think, except the first part.
--
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]