Replies: 2 comments 2 replies
-
|
@jemiahw please note that you can set a different FS to the one used for the worktree and dotgit. Refer to the tests for dotgit.NewWithOptions for more details. |
Beta Was this translation helpful? Give feedback.
-
|
I was able to get things working by using three separate filesystems. One for the storer, one for the worktree, and one for the alternates. Thank you to everyone who commented with suggestions. My repo root is at The git repo uses an alternate. The To open the repo, I use code like this: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a git repo in
/builds/default-i-044c26eb54cb1e663-7/foo/myproject.That repo has an alternate that points to an absolute directory outside of the repo. The
.git/objects/info/alternatesfile points to/mirrors/https---github-com-foo-myproject/objects(note that this is an absolute path, outside the current repo).Following the code, I see it drops into the DotGit.Alternates() method to handle the alternate. Since it is an absolute path, it drops into the block on line 1176 here. The fs type is a ChrootHelper, so it drops into the block to convert this to a relative path. It converts it to
../../../../../mirrors/https---github-com-foo-myproject/objects.Then it tries to call
fs.Stat("../../../../../mirrors/https---github-com-foo-myproject/objects")on that path on line 1196, which fails with an errorchroot boundary crossed.So it looks like this doesn't work if the alternate directory is outside the
.gitdirectory since that would always cross the chroot boundary. But isn't the point of the alternate that the objects exist somewhere else? I don't see how this ever works, but it must work somehow. Do I need to do some other initialization other than PlainOpen?Beta Was this translation helpful? Give feedback.
All reactions