git-lfs/subprocess
Patrick Lühne 7838572d72
Support submodule.recurse = true
Git’s configuration option submodule.recurse makes it more convenient to
use submodules. If set to true, top-level checkouts will recurse into
all submodules. Additionally, Git will pass an environment variable
called GIT_INTERNAL_SUPER_PREFIX to the respective submodule’s path
relative to its parent repository to each child process, including git
lfs filter-process.

In turn, Git LFS spawns a couple of Git processes, for instance, when
checking the minimum required Git version, reading Git configuration
values, or obtaining the object name of a commit with git rev-parse.

In the current implementation, Git LFS would forward the environment
variable GIT_INTERNAL_SUPER_PREFIX to Git unchanged. This is problematic
because the presence of this environment variable will make Git behave
as if the command-line option --super-prefix had been passed to the
respective Git command. However, many commands don’t support the
--super-prefix command-line option. This includes git version, git
config, and git rev-parse. Consequently, these Git processes, as spawned
by Git LFS, would immediately fail with a usage error.

In short, users of submodule.recurse = true would get errors when
working in repositories with at least one Git-LFS-enabled submodule.

This patch fixes the issue by removing the GIT_INTERNAL_SUPER_PREFIX
environment variable from the environment Git LFS passes to Git child
processes.
2020-03-10 01:59:46 +01:00
..
buffered_cmd.go git: add git[NoLFS]Buffered() to run a Git processes with buffered output 2017-08-22 19:34:29 +02:00
cmd.go Fix for #1874 2017-01-19 09:37:26 -05:00
subprocess_nix.go Fix for #1874 2017-01-19 09:37:26 -05:00
subprocess_test.go subprocess: add functions to format shell commands 2018-09-14 22:31:39 +00:00
subprocess_windows.go Fix for #1874 2017-01-19 09:37:26 -05:00
subprocess.go Support submodule.recurse = true 2020-03-10 01:59:46 +01:00