Re: [PATCH] Fixes handling of --reference argument.

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

 



On Thu, Oct 25, 2012 at 04:36:26AM -0400, Jeff King wrote:
> On Wed, Oct 24, 2012 at 09:52:52PM -0700, szager@xxxxxxxxxx wrote:
> > diff --git a/git-submodule.sh b/git-submodule.sh
> > index ab6b110..dcceb43 100755
> > --- a/git-submodule.sh
> > +++ b/git-submodule.sh
> > @@ -270,7 +270,6 @@ cmd_add()
> >  			;;
> >  		--reference=*)
> >  			reference="$1"
> > -			shift
> >  			;;
> 
> Is that right? We'll unconditionally do a "shift" at the end of the
> loop. If it were a two-part argument like "--reference foo", the extra
> shift would make sense, but for "--reference=*", no extra shift should
> be neccessary. Am I missing something?

Both the patch and Jeff's analysis are right.  You only need an
in-case shift if you consume "$2", or you're on ‘--’ and you're
breaking before the end-of-case shift.

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachment: signature.asc
Description: OpenPGP digital signature


[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]