Re: [PATCH 1/2] mirror pushing
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 8, 2007, 15:03 UTC
- Message-ID
- <Pine.LNX.4.64.0711081441260.4362@racer.site>
- In-Reply-To
- <1194531890.0@pinky>
Hi,
On Thu, 8 Nov 2007, Andy Whitcroft wrote:
> - nr_refspec, refspec, args.send_all)) > + nr_refspec, refspec, args.send_all | (args.send_mirror << 1)))
This line is too long. But it needsmore love: it's all too magic to have a 1 for send_all, and a 2 for mirror. Please introduce an enum for that in remote.h, and use those constants, so that this hunk and the following one cannot get out of sync that easily.
Show 15 quoted lines
> +++ b/remote.c
> @@ -722,10 +722,12 @@ static const struct refspec *check_pattern_match(const struct refspec *rs,
> * without thinking.
> */
> int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,
> - int nr_refspec, const char **refspec, int all)
> + int nr_refspec, const char **refspec, int flags)
> {
> struct refspec *rs =
> parse_ref_spec(nr_refspec, (const char **) refspec);
> + int send_all = flags & 01;
> + int send_mirror = flags & 02;
>
> if (match_explicit_refs(src, dst, dst_tail, rs, nr_refspec))
> return -1;Thanks, Dscho