diff options
author | Stan Hu <stanhu@gmail.com> | 2015-07-01 14:42:55 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-07-01 14:42:55 +0000 |
commit | 8969a8235c5276fda7200001bfc082a822ecbe4a (patch) | |
tree | d0c34803d437a934aad6833d5b9733eda5192c45 /doc/gitlab-basics | |
parent | 3603edcff4d18ae0341213d7151325dda04aa9b3 (diff) | |
parent | 9add3e6eb56bb8d8a9b8e4e105f7beec27e685d2 (diff) | |
download | gitlab-ce-8969a8235c5276fda7200001bfc082a822ecbe4a.tar.gz |
Merge branch 'fix-multiple-ref-prefix' into 'master'
Extract the longest-matching ref from a commit path when multiple matches occur
### What does this MR do?
This MR extracts the longest-matching ref from a commit path. In cases when there are multiple refs that prefix the path, the ref name is ambiguous. Using the heuristic that the longest-matching ref seems like a sensible default.
### Why was this MR needed?
Suppose there is a branch named `release/app` and a tag named `release/app/v1.0.0`. Suppose `README.md` exists in the root directory.
Let's suppose the path passed in is `release/app/v1.0.0/README.md`. There are two possible ways to interpret the ref and path:
1. ref = `release/app`, path = `v1.0.0/README.md`
2. ref = `release/app/v1.0.0`, path = `README.md`
The crux of the issue is that there is ambiguity which one is correct; both could be real possibilities. In the current implementation of `extract_ref`, GitLab gets confused and tries neither: it uses ref = `release` and path = `app/v1.0.0/README.md`. Since the file does not exist, it returns 404.
### What are the relevant issue numbers?
Closes #1839
See merge request !859
Diffstat (limited to 'doc/gitlab-basics')
0 files changed, 0 insertions, 0 deletions