Re: [PATCH v3] sha1-name.c: Fix handling of revisions that contain paths with brackets

2019-01-02 Thread Junio C Hamano
Stan Hu writes: > - if (len < 4 || name[len-1] != '}') > + if (len < 4) > return -1; The original does not expect any string given after the ^{} dereferencer, like :, and that is why this function returns very early for anything when name[len-1] is not a closing brace. We

[PATCH v3] sha1-name.c: Fix handling of revisions that contain paths with brackets

2018-12-28 Thread Stan Hu
Previously, calling ls-tree with a revision such as `master^{tree}:foo/{{path}}` would show the root tree instead of the correct tree pointed by foo/{{path}}. We improve this by ensuring peel_onion() consumes all "len" characters or none. Note that it's also possible to have directories named ^{tr