Skip to content

lfs.fetchinclude no longer works with directories #4945

@nuxi

Description

@nuxi

Describe the bug

Using lfs.fetchinclude with a directory no longer works with the 3.x releases of git-lfs. (It worked fine with the 2.x releases)

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/nuxi/git-lfs-bug.git
  2. Check the contents of .lfsconfig and see that lfs.fetchinclude = foo is set.
  3. Check to see if foo/should_be_a_binary.bin is the pointer or a binary.
  4. Check to see if bar/should_be_a_pointer.bin is the pointer or a binary.

Expected behavior

I think the filenames are obvious enough, but with git-lfs 3.x, the foo/should_be_a_binary.bin file is still a pointer. Under git-lfs 2.x, the file is the binary.

System environment

Debian Sid

Output of git lfs env

git-lfs/3.0.2 (GitHub; linux amd64; go 1.17.2)
git version 2.35.1

Endpoint=https://github.com/nuxi/git-lfs-bug.git/info/lfs (auth=none)
LocalWorkingDir=/home/nuxi/src/git-lfs-bug/lfs3-main
LocalGitDir=/home/nuxi/src/git-lfs-bug/lfs3-main/.git
LocalGitStorageDir=/home/nuxi/src/git-lfs-bug/lfs3-main/.git
LocalMediaDir=/home/nuxi/src/git-lfs-bug/lfs3-main/.git/lfs/objects
LocalReferenceDirs=
TempDir=/home/nuxi/src/git-lfs-bug/lfs3-main/.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=/home/nuxi/src/git-lfs-bug/lfs3-main/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
FetchInclude=foo
GIT_EXEC_PATH=/usr/lib/git-core
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"

Additional context

The same repo, but with the config option pointing directly at the exact binary file is fine. You can try this with git clone -b exact https://github.com/nuxi/git-lfs-bug.git

Support for specifying a directory is documented in the manual as the very first example - https://github.com/git-lfs/git-lfs/blob/v3.1.2/docs/man/git-lfs-fetch.1.ronn#examples

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions