Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is another approach to fixing #922.
While #927 fixes the bug, I'm not completey happy with it. Calling
git.RootDir()
inloadGitConfig()
adds another os exec that's run on every lfs command. This is in addition to when it's run insideresolveGitDir()
if theGIT_DIR
is specified. I'd like to fix the behavior without runninggit.RootDir()
again.The problem:
git submodule update --init --remote
runsgit lfs smudge
commands with the following env:When run with the above ENV vars,
LocalWorkingDirectory
is/path/to/repo/.git/modules
, which is wrong. It should be/path/to/repo/sub
, wheresub
is the path for the submodule. Here's the code:If we treat
GIT_WORK_TREE=.
relative to the process' current working directory, it works just fine. It seems like the comments (which are taken directly from the git docs) are wrong in this case. I can pass both--git-dir
and--work-tree
to get the status of my local git-lfs repo, from a totally different directory:If I try relative to the
.git
directory, it doesn't work.If I try relative to the current working directory, while in the git-lfs directory, it works:
@sinbad @rikdev: Thoughts?