threads / bug / 41149

[BUG] git add . after removing .git/ in a subdirectory triggers assertion failure

Subject: [BUG] git add . after removing .git/ in a subdirectory triggers assertion failure

## tl;dr

2 messages between Jan 8, 2016 and Jan 8, 2016.

replies: 1people: 2as markdown or json

Matthieu Moy· Jan 8, 2016, 11:33 UTC · lore
Hi,
No time to debug this for now, but I have a reproduction script:

mkdir test && cd test git init sub cd sub/ touch foo && git add . && git commit -m"foo" cd .. git init git add sub rm -fr sub/.git/ cd sub/ git add .

In short, sub used to be a submodule, but we removed the .git/ and tried to "git add ." the result.

The last line triggers this:
git: pathspec.c:317: prefix_pathspec: Assertion `item->nowildcard_len <= item->len && item->prefix <= item->len' failed.
Cheers,
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Duy Nguyen· Jan 8, 2016, 12:10 UTC · re: Matthieu Moy · lore

Re: [BUG] git add . after removing .git/ in a subdirectory triggers assertion failure

On Fri, Jan 8, 2016 at 6:33 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:

Show 21 quoted lines
> Hi,
>
> No time to debug this for now, but I have a reproduction script:
>
> mkdir test && cd test
> git init sub
> cd sub/
> touch foo && git add . && git commit -m"foo"
> cd ..
> git init
> git add sub
> rm -fr sub/.git/
> cd sub/
> git add .
>
> In short, sub used to be a submodule, but we removed the .git/ and tried
> to "git add ." the result.
>
> The last line triggers this:
>
> git: pathspec.c:317: prefix_pathspec: Assertion `item->nowildcard_len <= item->len && item->prefix <= item->len' failed.
Reported twice in the past and I failed to provide a proper fix:
http://thread.gmane.org/gmane.comp.version-control.git/267095/focus=267404
-- 
Duy

← back to recent threads