]> git.feebdaed.xyz Git - 0xmirror/git-lfs.git/commit
commands,lfs: rename SmudgeToFile() path parameter
authorChris Darroch <chrisd8088@github.com>
Mon, 3 Nov 2025 04:15:14 +0000 (20:15 -0800)
committerChris Darroch <chrisd8088@github.com>
Tue, 11 Nov 2025 05:50:03 +0000 (21:50 -0800)
commit901ea68b173d4922e96374bcfbcfe59f9fe931b1
treef601f7651cfa022000ebe7505db699ff4bcead2a
parent1e3bf3bdf75f2bbd6ef469085ae8973177059bf7
commands,lfs: rename SmudgeToFile() path parameter

The first parameter of the SmudgeToFile() method of the GitFilter
structure in our "lfs" package is named "filename", and is expected
to contain the path of the file the method should create.  This path
is expected to be relative to the current working directory, which
since commit e735de58a72f1333a16054985b85b863fbaec138 of our "main"
development branch and commit a3189870e5d664fe9a1b5d8870453bf3f0e1352b
of our "release-3.7" branch is also the root of the current Git
working tree.

The only caller of SmudgeToFile() method is the RunToPath() method of
the singleCheckout structure in our "commands" package, which was added
in commit cf7f9678b3d2929425d0671c099c2ef5621c0929 of PR #3296, when the
"git lfs checkout" command was enhanced with the ability to write the
contents of a Git LFS file from different merge conflict stages into a
file specified by the user with the --to option.

The RunToPath() method also accepts a file path as one of its parameters,
which it then passes to the SmudgeToFile() method as its "filename"
parameter with any alteration.  However, the parameter of the RunToPath()
method is named "path" rather than "filename", even though they always
contain the same value.

To help clarify the relationship between these two parameters, we
rename the SmudgeToFile() method's "filename" parameter to "path",
which somewhat more accurately describes the expected contents of
the parameter, since it will often not be a plain filename but a
relative path with both directory and filename components.
lfs/gitfilter_smudge.go