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

It seems that AlternateFS doesn't work with git's clone --shared #1006

Open
wxiaoguang opened this issue Jan 22, 2024 · 0 comments
Open

It seems that AlternateFS doesn't work with git's clone --shared #1006

wxiaoguang opened this issue Jan 22, 2024 · 0 comments

Comments

@wxiaoguang
Copy link

wxiaoguang commented Jan 22, 2024

It seems that AlternateFS doesn't work with git's clone --shared. For example:

  • There is a repo /path1/....../gitea-repositories/user2/repo-pull-request-target.git ( altRepoPath )

  • Then "clone --shared" to /path2/....../temp.git

  • If I use osfs.New(altRepoPath, osfs.WithChrootOS())

    • then func (d *DotGit) Alternates() changes the path to ../../../../../../../../gitea-repositories/user2/repo-pull-request-target.git/objects, which is inaccessible, then Alternates returns error.
  • If I use osfs.New(altRepoPath, osfs.WithBoundOS())

    • then func (d *DotGit) Alternates() insists to use path /path1/....../gitea-repositories/user2/repo-pull-request-target.git/path1/....../gitea-repositories/user2/repo-pull-request-target.git (duplicated, strange), which is still incorrect, the path is inaccessible.

Then, whatever I used to construct AlternateFS, I couldn't make DotGit work. The only working approach is: AlternativeFS: osfs.New("/")

@wxiaoguang wxiaoguang changed the title It seems that AlternateFS doesn't work with git's clone --shared relative path It seems that AlternateFS doesn't work with git's clone --shared Jan 22, 2024
lunny pushed a commit to go-gitea/gitea that referenced this issue Jan 23, 2024
More details are in the comment of repo_base_gogit.go

And ref: go-git/go-git#1006
henrygoodman pushed a commit to henrygoodman/gitea that referenced this issue Jan 31, 2024
More details are in the comment of repo_base_gogit.go

And ref: go-git/go-git#1006
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
More details are in the comment of repo_base_gogit.go

And ref: go-git/go-git#1006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant