Path breadcrumbs incorrect when path contains more than 6 skipped paths and contains duplicated directory names
Summary
The breadcrumbs while browsing the repository appears to show the incorrect path when there are many "skipped paths" (directories containing only a single directory or file).
Steps to reproduce
- Create and upload a repository that contains a directory structure nested more than 6 levels deep where each directory only contains one child directory or file. An example would be a Java project using Maven. Note that one of the directory names should probably be duplicated (see note under actual behavior).
- Navigate to deepest nested level.
- Observe the breadcrumbs shown just below the second level nav bar.
Expected behavior
With path subproject/src/main/java/com/example/projname/subproject/ClassName.java
, the breadcrumb should show "ProjectName / .. / projname / subproject / ClassName.java". This goes on in a similar fashion until you're at subproject/src/main/java/com/example
, where the full path is shown.
Actual behavior
- With path
subproject/src/main/java/com/example/projname/subproject/ClassName.java
, the breadcrumb shows "ProjectName / .. / subproject / subproject / ClassName.java". - With path
subproject/src/main/java/com/example/projname/subproject
, the breadcrumb shows "ProjectName / .. / subproject / projname / subproject". - With path
subproject/src/main/java/com/example/projname
, the breadcrumb shows "ProjectName / .. / example / projname", as expected. - With path
subproject/src/main/java/com/example
, the breadcrumb shows "ProjectName / subproject / src / main / java / com / example", as expected. - Note for the first two cases, the first "subproject" links to the "subproject" directory under the repository root.
Relevant logs and/or screenshots
Screenshot omitted for privacy (I don't have a test repo just for this issue).
Results of GitLab application Check
Checking GitLab Shell ...
GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
2/1 ... ok
2/2 ... ok
2/3 ... ok
2/4 ... ok
2/5 ... ok
4/6 ... ok
2/7 ... ok
2/8 ... ok
10/9 ... ok
2/10 ... ok
2/11 ... ok
2/12 ... ok
7/13 ... ok
10/15 ... ok
4/16 ... ok
4/17 ... ok
2/18 ... ok
2/19 ... ok
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /home/git/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ...
2/1 ... yes
2/2 ... yes
2/3 ... yes
2/4 ... yes
2/5 ... yes
4/6 ... yes
2/7 ... yes
2/8 ... yes
10/9 ... yes
2/10 ... yes
2/11 ... yes
2/12 ... yes
7/13 ... yes
10/15 ... yes
4/16 ... yes
4/17 ... yes
2/18 ... yes
2/19 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/usr/bin/git"
Git version >= 2.7.3 ? ... yes (2.11.0)
Active users: 7
Checking GitLab ... Finished
Results of GitLab environment info
System information
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.5.1
Bundler Version:1.13.1
Rake Version: 10.5.0
Sidekiq Version:4.2.7
GitLab information
Version: 8.15.3
Revision: 76bd8ddd4f
Directory: /home/git/gitlab
DB Adapter: postgresql
URL: https://<omitted>
HTTP Clone URL: https://<omitted>/some-group/some-project.git
SSH Clone URL: git@<omitted>:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: bitbucket
GitLab Shell
Version: 4.1.1
Repository storage paths:
- default: /media/sdb1/git-repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
Possible fixes
Maybe there's an assumption here?