Commit Graph

10 Commits

Author SHA1 Message Date
Chris Darroch
e983982d35 t/t-migrate-info.sh: add --pointers option tests
We add a number of tests of the functionality of the new
--pointers option to the "migrate info" command in order
to confirm it works as expected in all modes, and both with
and without Git LFS pointers in the test repositories.

We also add tests of repositories where some file extensions
are tracked in .gitattributes files and the corresponding blobs
should be Git LFS pointers, but are not yet.  In these cases,
we do want to report these file extensions in summary data of
the output listing.

In order to ensure our tests succeed on Windows, we alter
several fixture setup functions to create the .gitattributes
files using "echo" instead of "git lfs track".  This keeps
the line endings consistent across platforms, and therefore
the .gitattributes file sizes in the "migrate info" summaries.
2021-05-01 21:31:04 -07:00
Chris Darroch
b6a32b71d4 t: fix typo and remove unused debugging commands 2021-03-10 20:43:58 -08:00
brian m. carlson
dd463c624f
migrate import: ensure all files end up in .gitattributes
Currently, if we have a file and it contains an extension, we'll add
that extension to the list of paths that should be placed in
.gitattributes.  However, if the file does not contain an extension, it
won't be listed at all.  As a result, we may convert a file flagged by
the --above option but never cause Git to filter it properly.

Let's fix this by writing an attribute into the repository with the path
relative to the root if we don't contain an extension.  This means that
people can store typical Unix binaries, which lack extensions, as LFS
files more easily.
2020-11-23 22:11:09 +00:00
Eli Ribble
5a4f2eb7f9 Add --above parameter to 'migrate import'.
The purpose is to allow users to tell git-lfs to migrate
all files over a particular threshold without having to determine
the various paths and patterns that would. This is very useful
for large code bases with inconsistent history of adding large
files in different places. This option makes it possible to
supply `git-lfs migrate import --everything --above=1Mb` and
have git-lfs do the convenient thing and rewrite history.
2020-11-05 18:57:25 -08:00
brian m. carlson
9e006ac4e2
Rename default branch in tests to "main"
Currently, our default branch in tests is "master".  This is the Git
default, but the Git default will likely change in the future, so it
makes sense to update our testsuite to be explicit about the branch
name.  We'll ensure this continues by building against older versions of
Git as well as newer versions.

We use "main" for the new branch name, since that's the proposed value
upstream.

This commit was made entirely by automated means using the following
command:

  git grep -l master t | xargs sed -i -e 's/master/main/g'
2020-07-08 15:38:17 +00:00
brian m. carlson
3c6defef24
t: add a template directory for Git
In future versions of Git, the default branch name will likely change
from "master" to "main".  We'd like to make this change as well.  In
order to make the default branch the same in all versions of Git, let's
use a template directory to initialize the repositories that we're
creating.  This works with Git 1.8.3.1, which is available in CentOS 7,
as well as all newer versions.

For now, we set the branch name to "master", but in a future commit,
we'll change the name to "main".

We move the native_path helper into testenv.sh so that we can
canonicalize the GIT_TEMPLATE_PATH environment variable.  Git itself
canonicalizes this internally and the tests for git lfs env will fail if
we don't canonicalize it ourselves.
2020-07-08 15:38:16 +00:00
Zac Romero
1ba20cbb56 Modify logic of 'migrate info' to process extensionless files 2019-01-08 12:44:06 +03:00
Taylor Blau
351c81fc5d Merge branch 'master' into ttaylorr/prove 2018-07-23 11:12:04 -05:00
Taylor Blau
9afae6f6fc Merge branch 'master' into ttaylorr/prove 2018-07-17 12:54:38 -05:00
Taylor Blau
e0ed17dd0f t: move 't-migrate-fixtures.sh' to 'fixtures' 2018-07-11 13:18:25 -05:00