Skip to main content

Module lfs_push_precheck

Module lfs_push_precheck 

Source
Expand description

The check that git-lfs can start, made before a push that is preceded by the upload. What: The check, before anything starts, that the Git LFS upload a push is about to run can start. Why: A push of a repository with LFS keys is preceded by git-lfs push, which the parent starts. When no directory of PATH holds git-lfs, one stat per PATH directory, with no process started, finds that first, and the parent says so with the full explanation. A push that bypasses the upload (--no-verify, GIT_LFS_SKIP_PUSH, or the switch -c hook.cli-git-lfs-pre-push.enabled=false) needs no program, so it is never refused here.

In TS you’d write (pseudocode):

const refusal = hookIsActive(prefix, region) && !programOnPath(env.PATH) ? missingProgramMessage() : undefined;

Functions§

lfs_refusal
What: The refusal text when the upload hook is active and git-lfs is not on the invocation’s PATH. Why: A region Git itself would refuse is left to Git, which says why.