Drop unused generic stub function for cloning files #6050
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the
CloneFile()stub function defined in ourlfspackage for non-Linux operating systems, as it is entirely unused.With this change, we remove the last use of a
cgoGo build constraint from our code base.Background
This
CloneFile()stub function is a remnant of the original support for Git LFS object file deduplication added in PR #952, at which time we only implemented this function for Linux systems with Btrfs filesystems, so we defined two versions of the newCloneFile()function in ourlfspackage, one for Linux, and one for all other types of systems.The only caller of the
CloneFile()function at the time was theCopyWithCallback()function. When that was moved into ourtoolspackage in PR #1265, the two implementations ofCloneFile()function were also copied to thetoolspackage at the same time, in commit 1ef2d43.However, while the Linux version was completely moved to the
toolspackage by renaming thelfs/util_linux.gosource file totools/util_linux.go, the generic version was only copied to a newtools/util_generic.gosource file, leaving the originallfs/util_generic.goin place.As the
lfs/util_generic.gosource file and theCloneFile()function it defines within thelfspackage are no longer used, we can simply delete them now.