What the checkout leaves on disk#
The checkout action's lfs input, "Whether to download Git-LFS files", defaults to false. actions/checkout inputs When it is false, the action sets GIT_LFS_SKIP_SMUDGE=1 for its Git commands, in its source. That variable tells Git LFS to skip converting pointers into their objects on checkout. git-lfs-config
What remains is a text file of under 1024 bytes, holding a version line, the object's oid sha256: and its size. Git LFS pointer format The file has the right path and is readable. Its content is not the data.
A table of test cases that became the pointer#
The fixture tracks testdata/*.csv with Git LFS, then clones with smudge skipped, as the checkout action does. Its test reads conversion cases and ignores lines that do not have two fields, a common way to skip comments and blank lines:
def load_cases():
with open("testdata/cents.csv", newline="") as f:
return [row for row in csv.reader(f) if len(row) == 2]
def test_cents_table():
for cents, expected in load_cases():
assert to_euros(int(cents)) == expected
Run with git 2.49.1, git-lfs 3.6.0 and pytest 8.3.5 in alpine:3.22:
$ cat testdata/cents.csv
version https://git-lfs.github.com/spec/v1
oid sha256:c493ca13a9d0867453ff2688bd2c8f9af22ae6d87a2f1a33e0e2810e7472187e
size 33
$ python3 -m pytest -q -p no:cacheprovider
. [100%]
1 passed in 0.01s
exit 0
$ git lfs ls-files
c493ca13a9 - testdata/cents.csv
$ git lfs pull && git lfs ls-files
c493ca13a9 * testdata/cents.csv
[…]
$ python3 -m pytest -q -p no:cacheprovider
. [100%]
1 passed in 0.01s
exit 0
$ sed -i s/0.05/0.50/ testdata/cents.csv && python3 -m pytest -q -p no:cacheprovider | tail -1
1 failed in 0.03s
None of the pointer's lines contains a comma, so load_cases() returned nothing and the loop asserted nothing. After git lfs pull, the same test ran three cases, and changing one expected value made it fail. Both runs reported 1 passed, so the pass count does not tell them apart.
The ls-files manual documents the marker: "An asterisk (*) after the OID indicates a full object, a minus (-) indicates an LFS pointer."
Make the job prove it had the objects#
- uses: actions/checkout@v7
with:
lfs: true
- run: |
files=$(git lfs ls-files)
printf '%s\n' "$files"
! printf '%s\n' "$files" | grep -E '^[0-9a-f]+ - '
shell: bash
The last command fails the step when any LFS path is still a pointer, and the list stays in the log for the reviewer. The listing runs on its own line so that a failing git lfs ls-files stops the step; inside a pipeline, its failure would leave grep with no input and the check would pass. The check also passes for a file LFS does not track at all, so compare the list with the paths the tests read. In the test itself, assert that the case list is not empty. That guard also catches a table that is really empty, which the pointer check cannot see.
What a green run covers#
| Observation | Covers | Cannot exclude |
|---|---|---|
Test passed, no ls-files output in the log | The code ran | That it read pointers |
ls-files shows * for every path | The job had the objects at that commit | A test that skips every case for another reason |
| Non-empty assertion passed | The test read at least one case | That it read the cases you expected |
A commit that moves existing files into LFS produces the same silent result on the next run, without any change to the tests. A new track rule alone leaves files already committed as ordinary Git objects until they are staged again. Compare the run's ls-files list with the paths the tests read.
For other inputs the checkout leaves out, see submodules that were not fetched. For reviewing an LFS change without its payload, read what a pointer lets you verify.