git-lfs/commands
brian m. carlson 95d1c1f737
commands: canonicalize paths properly on Windows
When we form a lock path, we take the working directory and resolve all
symlinks in it, and then append the name of the file specified on the
command line.  However, the working directory we get need not be
canonicalized for the system: it may contain lowercase drive paths (on
Windows) or components that differ in case or normalization from the
canonical form written on the file system.

We then made the path relative to the root of the repository by using
the strings module to pull of the prefix of the Git repository, which
will always be canonicalized.  If the working directory was
noncanonical, the paths would end up just concatenated together, leading
to failures down the line.  On Windows, this could lead to multiple
drive components, and hence a syntax error when trying to use the path.

Use the filepath.Rel function that's built into Go to help us make the
path relative in a way that is appropriate for the operating system.
Convert the path to slashes so that we store paths using slashes and
expose only slashes to the remote API.
2018-09-21 17:52:53 +00:00
..
command_checkout.go Merge pull request #3055 from git-lfs/checkout-no-confusing-message 2018-06-11 15:28:47 -05:00
command_clean.go progress,tools: move CopyCallback (and related) to 'tools' 2017-11-22 14:08:33 -08:00
command_clone.go commands: teach pull() to get remote from cfg.Remote() 2017-10-27 16:11:16 -06:00
command_env.go config: add origin to remote list 2018-07-26 11:40:47 -07:00
command_ext.go update package imports 2016-11-15 10:01:18 -07:00
command_fetch.go tq: new progress meter formatting 2018-01-05 18:43:31 -08:00
command_filter_process.go tq, commands: send refspec on batch upload calls 2018-01-05 11:12:57 -07:00
command_fsck.go commands/fsck: attach a filter to exclude unfetched items from fsck 2018-01-31 18:16:43 -08:00
command_install.go lfs: use *git.Configuration instance 2017-10-25 16:12:29 -06:00
command_lock.go commands: canonicalize paths properly on Windows 2018-09-21 17:52:53 +00:00
command_locks.go commands: remove internal refUpdate type in favor of git.RefUpdate 2018-01-05 15:22:25 -07:00
command_logs.go remove reliance on global config filesystem vars 2017-10-18 18:09:33 -06:00
command_ls_files.go commands/command_ls_files: hide index with arguments 2018-09-05 10:33:27 -04:00
command_migrate_export.go commands: warn if working copy is dirty 2018-07-10 13:17:32 -05:00
command_migrate_import.go commands/command_migrate_import.go: install hooks 2018-09-05 10:50:57 -04:00
command_migrate_info.go *: replace git/odb with vendored copy 2018-07-05 11:50:21 -05:00
command_migrate.go git: add a function to look up common directory 2018-09-11 17:47:21 +00:00
command_pointer.go git: change gitHashObject() to accept an io.Reader 2017-08-22 19:34:30 +02:00
command_post_checkout.go Update usage info for post-checkout 2018-01-19 21:28:09 -05:00
command_post_commit.go commands: remove any cfg.Remote() calls from Command flags 2017-10-27 15:07:36 -06:00
command_post_merge.go commands: remove any cfg.Remote() calls from Command flags 2017-10-27 15:07:36 -06:00
command_pre_push.go commands: remove internal refUpdate type in favor of git.RefUpdate 2018-01-05 15:22:25 -07:00
command_prune.go prune: format code consistently 2018-02-13 18:26:34 +01:00
command_pull.go tq: remove MeterOptions in favor of fields 2017-12-07 15:13:11 -07:00
command_push.go commands/command_push.go: set pushRemote 2018-07-20 16:38:39 -07:00
command_smudge.go lfs: remove LocalMediaPath() 2017-10-25 11:31:15 -06:00
command_status.go commands/status: make paths relative to the working directory 2018-06-21 15:38:17 -05:00
command_track.go Fix #3189 by making lfs track properly compare escaped patterns 2018-08-21 15:42:18 +03:00
command_uninstall.go commands/uninstall: do not log about global hooks with --local 2018-04-18 15:21:59 -07:00
command_unlock.go commands: remove internal refUpdate type in favor of git.RefUpdate 2018-01-05 15:22:25 -07:00
command_untrack.go commands/{un,}track: local-prefix agnostic comparison 2018-04-05 10:51:26 -07:00
command_update.go git: remove unused arg 2017-10-25 19:20:35 -06:00
command_version.go lfsapi: extract new lfshttp package 2018-09-11 14:51:29 -07:00
commands_test.go all: expand config.Environment interface to support multiple values per key 2017-04-12 17:29:11 -04:00
commands.go commands,config: permit (*configuration).HookDir() to error 2018-08-30 15:27:05 -04:00
lockverifier.go lfsapi: extract new lfshttp package 2018-09-11 14:51:29 -07:00
path_nix.go commands: osLineEnding() is more descriptive 2017-02-03 17:50:47 -07:00
path_windows.go commands: osLineEnding() is more descriptive 2017-02-03 17:50:47 -07:00
path.go commands/path.go: add documentation to trimCurrentPrefix 2018-04-05 12:17:37 -07:00
pointers.go each command should open and close a gitscanner just once 2016-11-17 17:22:21 -07:00
pull.go lfs: remove static lfs pointer clean/smudge funcs 2017-10-24 12:07:53 -06:00
run.go commands/run.go: make --version synonymous with version() 2018-05-21 18:19:33 -07:00
uploader_test.go commands: extract lockVerifier from uploadContext 2017-11-01 17:35:43 -06:00
uploader.go commands/uploader: set lfs.allowincompletepush default to false 2018-07-05 23:20:02 +02:00