Re: [PATCH] Fix off by one error in prep_exclude.

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

 



On Sun, Jan 27, 2008 at 08:44:57PM +0000, Johannes Schindelin wrote:
> Hi,
> 
> On Sun, 27 Jan 2008, Shawn Bohrer wrote:
> 
> > base + current already includes the trailing slash so adding
> > one removes the first character of the next directory.
> > 
> > Signed-off-by: Shawn Bohrer <shawn.bohrer@xxxxxxxxx>
> > ---
> > 
> > This fixes the oops part of the issue Johannes found,
> 
> have I?
 
Sorry I should have been more explicit Johannes Sixt reported the issue,
you were included simply because you had been involved in the thread.

> > but doesn't address the fact that we probably should remove files that 
> > aren't a part of the repository at in the first place.
> 
> I am sorry, but I cannot begin to see what this commit tries to 
> accomplish.  Yes, sure, there is an off-by-one error, and your commit 
> message says how that was fixed.  But I miss a description what usage it 
> would affect, i.e. when this bug triggers.

As far as I can see there are two protential cases that could trigger
this bug, but there may be more.  This first was the arguably invalid
case the Johannes Sixt reported.

git clean -n /

The other case that could trigger this bug and potentially others is if
someone makes their root dircetory a git repository and then uses "/" as
an absolute path.  For example:

cd /
git init
git clean -n /

You may argue that both of these cases are invalid and that is fine by
me, but since I noticed this bug I thought I would send a patch.  If you
wouldlike I can add these two use cases to the commit message.

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

  Powered by Linux