-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Describe the bug
When trying to git-lfs migrate import a repo in which there are copied files (eg: dirA/file = dirB/file), the .gitattributes file does not list all instances of the file but they are all changed to a pointer blob. This results in a incoherent repo.
To Reproduce
Steps to reproduce the behavior:
- Create a test repo with this script :
git init
echo test > a
mkdir dir
cp a dir/
git add a dir/a
git commit -m "add a dir/a"
# In this repo a & dir/a have the same name and content
- Import the repo in git-lfs :
git lfs migrate import --above=1b - Look at .gitattributes and notice that
dir/ais missing
$ cat .gitattributes
/a filter=lfs diff=lfs merge=lfs -text
- Look at
dir/aand notice that it is a "LFS pointer blob" :
$ cat dir/a
version https://git-lfs.github.com/spec/v1
oid sha256:f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2
size 5
- To go further, doing a
git-lfs checkoutresult in a dirty repo (dir/apointer is replaced by its content but without a filter, so git notices the change)
$ git-lfs checkout
Checking out LFS objects: 100% (2/2), 10 B | 0 B/s, done.
$ git status
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: dir/a
- As a workaround, I can
git-lfs track dir/aand commit the resulting modifications.
NB: I can't reproduce this behavior if the name are different (eg a = dir/b)
Expected behavior
After the git lfs migrate import ..., a and dir/aare listed in .gitattributes.
System environment
Tested on a master (commit 16da803) build on a Debian 11 (bullseye).
Output of git lfs env
git-lfs/2.13.0 (GitHub; linux amd64; go 1.15.9)
git version 2.30.2
LocalWorkingDir=$BASE/git-lfs/debug_dir/tmp.1631551057.6tar
LocalGitDir=$BASE/git-lfs/debug_dir/tmp.1631551057.6tar/.git
LocalGitStorageDir=$BASE/git-lfs/debug_dir/tmp.1631551057.6tar/.git
LocalMediaDir=$BASE/git-lfs/debug_dir/tmp.1631551057.6tar/.git/lfs/objects
LocalReferenceDirs=
TempDir=$BASE/git-lfs/debug_dir/tmp.1631551057.6tar/.git/lfs/tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=$BASE/git-lfs/debug_dir/tmp.1631551057.6tar/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels