Commit Graph

3 Commits

Author SHA1 Message Date
brian m. carlson
75fb8f3719
commands: make sure we're in the working tree
In the normal case, Git commands perform repository autodiscovery based
on the current working directory.  However, in some cases, it's possible
to specify a Git working tree unrelated to the current working directory
by using GIT_WORK_TREE.  In such a case, we want to make sure that we
change into the working tree such that our working directory is always
within the working tree, if one exists.  This is what Git does, and it
means that when we write files into the repository, such as a
.gitattributes file, we write them into the proper place.

Note also that we adjust the code to require that the working directory
be non-empty when we require a working copy instead of that the
repository be non-bare.  That's because we don't want people to be
working inside of the Git directory in such situations, where the
repository would be non-bare but would not have a working tree.

We add tests for this case for track and untrack, which require a
working tree, and for checkout, which requires only a repository.  This
means that we can verify the behavior of the functions we've added
without needing to add tests for this case to each of the subcommands.
2020-10-14 20:58:28 +00:00
Chris Darroch
ad532efdec command/command_dedup.go: exit if extentions exist
The dedup command should not proceed if any Git LFS
extensions are configured, because these typically
will change the contents of the file (e.g., by
compression) which is written to the local LFS object
storage tree from what the user expects to see in
their working tree, and so the working tree files
should not be cloned (via filesystem reflinks) from
the object storage files.
2020-02-27 22:12:36 -08:00
Kazuki MATSUDA / 松田一樹
8c7ed55536
Add new command git lfs dedup for file system level deduplication.
Implements and closes https://github.com/git-lfs/git-lfs/issues/3740.
2019-08-19 10:44:37 +09:00