Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenter.Utilities.url returns wrong path when repository is git submodule #1000

Closed
pmagwene opened this issue Apr 13, 2019 · 0 comments · Fixed by #1004
Closed

Documenter.Utilities.url returns wrong path when repository is git submodule #1000

pmagwene opened this issue Apr 13, 2019 · 0 comments · Fixed by #1004
Milestone

Comments

@pmagwene
Copy link

pmagwene commented Apr 13, 2019

function url(repo, file; commit=nothing)

I'm developing a Julia project as a git submodule of another repository. When doing this, Documenter.Utilties.url appends an unneeded subdirectory into the path.

For example, Documenter creates this link:

https://github.com/user/project.jl/blob/{commit}/submodule/src/filename.jl#L1-3

when the correct link should be

https://github.com/user/project.jl/blob/{commit}/src/filename.jl#L1-3

Note the extra /submodule/ in the path.

I believe the problem is in the following lines, which construct the path:

    file = realpath(abspath(file))
    remote = getremote(dirname(file))
    isempty(repo) && (repo = "https://github.com/$remote/blob/{commit}{path}")
    path = relpath_from_repo_root(file)
mortenpi added a commit that referenced this issue Apr 28, 2019
repo_root fails if gitdir: in the .git file is a relative path, which
may be the case for submodules. Also add tests for the worktree case,
which so far was untested.

Fix #1000
@mortenpi mortenpi modified the milestones: 0.22.5, 0.22.4 Apr 28, 2019
mortenpi added a commit that referenced this issue May 5, 2019
repo_root fails if gitdir: in the .git file is a relative path, which may be
the case for submodules. Also add tests for the worktree case, which
so far was untested and remove some unnecessary debug output.

Fix #1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants