From: Bert Wesarg Date: Fri, 24 Jul 2009 18:12:56 GMT Subject: Re: [RFC PATCH v2 2/3] Introduce git-discard Message-ID: <36ca99e90907241112p6cc2c875q5fa4becd1169bfd3@mail.gmail.com> In-Reply-To: <51419b2c0907241102s31c2fbaeof81e2fb053465c89@mail.gmail.com> On Fri, Jul 24, 2009 at 20:02, Elijah Newren wrote: > On Fri, Jul 24, 2009 at 10:24 AM, Thomas Rast wrote: >> The new command 'git discard' is precisely the same as 'git checkout --'. >> +(This is the same as `git checkout \-- `.) > > Actually, there's an important difference: > >> +       exec git checkout "$@" > > $ git branch foo HEAD~20 > $ touch foo && git add foo > $ echo hi >> foo > $ git discard foo > A     foo > Switched to branch "foo" > > You really do need that "--". You fall into the same trap as me for patch 1/3. He does not shift away the '--', so it is still in "$@". Bert.