# Bug? Subtree merge seems to choke on trailing slashes.

3 messages from 2012-11-07 to 2012-11-14. Participants: Jack O'Connor, Junio C Hamano.
Thread: https://gitlist.dev/t/32034

## Jack O'Connor, 2012-11-07 01:58

Subject: Bug? Subtree merge seems to choke on trailing slashes.
Message-ID: <CA+6di1m7OCMjahP9sN3NcYdxLRRi4vmttFa5=pnHrgKp=E4+jQ@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B6di1m7OCMjahP9sN3NcYdxLRRi4vmttFa5%3DpnHrgKp%3DE4%2BjQ%40mail.gmail.com

```
I'm summarizing from here:
http://stackoverflow.com/questions/5904256/git-subtree-merge-into-a-deeply-nested-subdirectory

Quick repro:
1) I do an initial subtree merge in what I think is the standard way
(http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html).
My prefix is simply "test/".
2) I try to merge more upstream changes on top of that with the
following command:
git merge --strategy-option=subtree='test/' $upstream_stuff
3) Git fails with an obscure error:
fatal: entry  not found in tree daf4d0f0a20b8b6ec007be9fcafeac84a6eba4f0

If I remove the trailing slash from the command in step 2, it works just fine:
git merge --strategy-option=subtree='test' $upstream_stuff

Note in the error message above, there's a double space after "entry".
Is it looking for a tree with an empty name? Did my trailing slash
imply a directory named empty-string?

Thanks for your help.

-- Jack O'Connor

```

## Jack O'Connor, 2012-11-14 02:17

Subject: Re: Bug? Subtree merge seems to choke on trailing slashes.
Message-ID: <CA+6di1nsWOGXjchOc3SZ2FL79zGzgNqjOJyN0zf8Yb8GbXCpbA@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B6di1nsWOGXjchOc3SZ2FL79zGzgNqjOJyN0zf8Yb8GbXCpbA%40mail.gmail.com
In-Reply-To: <CA+6di1m7OCMjahP9sN3NcYdxLRRi4vmttFa5=pnHrgKp=E4+jQ@mail.gmail.com>

```
Do I have the right list for bug reports? Apologies if not.

On Tue, Nov 6, 2012 at 5:58 PM, Jack O'Connor <oconnor663@gmail.com> wrote:
>
> I'm summarizing from here:
> http://stackoverflow.com/questions/5904256/git-subtree-merge-into-a-deeply-nested-subdirectory
>
> Quick repro:
> 1) I do an initial subtree merge in what I think is the standard way
> (http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html).
> My prefix is simply "test/".
> 2) I try to merge more upstream changes on top of that with the
> following command:
> git merge --strategy-option=subtree='test/' $upstream_stuff
> 3) Git fails with an obscure error:
> fatal: entry  not found in tree daf4d0f0a20b8b6ec007be9fcafeac84a6eba4f0
>
> If I remove the trailing slash from the command in step 2, it works just fine:
> git merge --strategy-option=subtree='test' $upstream_stuff
>
> Note in the error message above, there's a double space after "entry".
> Is it looking for a tree with an empty name? Did my trailing slash
> imply a directory named empty-string?
>
> Thanks for your help.
>
> -- Jack O'Connor

```

## Junio C Hamano, 2012-11-14 20:11

Subject: Re: Bug? Subtree merge seems to choke on trailing slashes.
Message-ID: <7vvcd89c6x.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vvcd89c6x.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CA+6di1nsWOGXjchOc3SZ2FL79zGzgNqjOJyN0zf8Yb8GbXCpbA@mail.gmail.com>

```
"Jack O'Connor" <oconnor663@gmail.com> writes:

> Do I have the right list for bug reports? Apologies if not.

Yes.

> On Tue, Nov 6, 2012 at 5:58 PM, Jack O'Connor <oconnor663@gmail.com> wrote:
>>
>> 2) I try to merge more upstream changes on top of that with the
>> following command:
>> git merge --strategy-option=subtree='test/' $upstream_stuff
>> 3) Git fails with an obscure error:
>> fatal: entry  not found in tree daf4d0f0a20b8b6ec007be9fcafeac84a6eba4f0

I'd expect --strategy-option=subtree=./test, ././test (or ./test/
for that matter) would fail in a similar way, too.

What happens if you do not give an unnecessary '/' at the end?

If it works, I'd say that it falls into "dr. it hurts when I twist
my arm this way---don't do it then" category.

```
