git-lfs/lfs
brian m. carlson f4f8fae03d
commands: canonicalize certain Git environment variables
When we use certain Git environment variables to find the Git directory
and the working tree, we want those values to work regardless of what
directory we're in.  Currently we don't change the working directory,
but we soon will in order to mimic Git's behavior.  In order to make
relative values of these environment variables work correctly once we
change directories, let's turn them into absolute canonical paths when
we set up the repository.

We save the old environment variables into a variable and pass this
variable to the helper for the git lfs env command, which wants to print
the original values, not our modified ones.  Note that we can't make the
canonicalization conditional on the subcommand being run because the
configuration structure has been initialized by the time we get to
argument parsing and the configuration code invokes Git upon
initialization.

Because the Cygwin path canonicalization invokes a subprocess on Windows
and the subprocess code caches the environment, we must also reset the
cache after adjusting these environment variables so that future
subprocess invocations, like those for Git, work as expected with the
updated environment.
2020-10-14 16:49:23 +00:00
..
attribute.go add per-worktree configuration option 2020-06-26 14:56:04 -07:00
config_test.go move config.FetchPruneConfig -> lfs.FetchPruneConfig 2017-10-18 13:51:57 -06:00
config.go move config.FetchPruneConfig -> lfs.FetchPruneConfig 2017-10-18 13:51:57 -06:00
diff_index_scanner.go status: update index before showing status 2019-11-18 20:37:52 +00:00
extension.go Fix error strings to follow Go guidelines 2019-10-22 17:33:49 +03:00
gitfilter_clean.go filter-process: avoid hang when using git hash-object --stdin 2019-11-04 19:55:45 +00:00
gitfilter_smudge.go Check error when creating local storage directory 2020-02-10 16:07:59 +00:00
gitfilter.go lfs,git: send refspec in batch api calls from smudge filter 2018-01-05 15:01:29 -07:00
gitscanner_catfilebatch.go git: add a function to check object ID lengths 2020-07-29 20:53:43 +00:00
gitscanner_catfilebatchcheck.go lfs: parse git cat-file --batch-check output for SHA-256 2020-07-29 20:53:43 +00:00
gitscanner_catfilebatchcheckscanner_test.go lfs: teach gitscanner how to emit lockable files that aren't lfs objects 2017-02-16 16:52:40 -07:00
gitscanner_index.go git: pass Git environment to object scanner 2020-07-29 20:53:43 +00:00
gitscanner_log.go lfs,git: use "git log -m" to collect stash diffs 2020-08-26 20:44:07 -07:00
gitscanner_pointerscanner_test.go Support SHA-256 repositories 2020-07-29 20:53:44 +00:00
gitscanner_refs.go git: add a function to check for a zero object ID 2020-07-29 20:53:43 +00:00
gitscanner_remotes.go git: improve performance of remote ref listing 2020-07-01 22:51:27 -07:00
gitscanner_tree.go git: pass Git environment to object scanner 2020-07-29 20:53:43 +00:00
gitscanner.go prune: fix deleting objects referred to by stashes 2020-08-07 16:48:59 +01:00
hook.go Use proper repo permissions when creating directories 2018-12-13 17:51:02 +00:00
lfs_test.go t: move testutils.go to cmd sub-package 2018-07-13 12:54:18 -05:00
lfs.go commands: canonicalize certain Git environment variables 2020-10-14 16:49:23 +00:00
pointer_test.go commands,lfs: teach lfs.DecodeFrom to return an io.Reader 2016-12-23 12:16:57 -07:00
pointer.go Allow migrate export to handle non-pointer files gracefully 2019-11-08 17:20:45 +00:00
scanner_git_test.go Pass environment variables into object scanner 2019-08-15 17:39:32 +00:00
scanner_test.go extract a filepathfilter package 2016-11-21 11:38:39 -07:00
scanner.go git: pass Git environment to object scanner 2020-07-29 20:53:43 +00:00
util_generic.go Fix non linux with cgo build condition 2016-01-30 00:58:55 +03:00
util_test.go progress,tools: move CopyCallback (and related) to 'tools' 2017-11-22 14:08:33 -08:00
util.go Fix error strings to follow Go guidelines 2019-10-22 17:33:49 +03:00