-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Add support for git lfs (#306)
* feature: Add support for Git LFS Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com> * docs: Add notes about Git LFS Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
- Loading branch information
Showing
8 changed files
with
139 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package git | ||
|
||
import ( | ||
"os/exec" | ||
) | ||
|
||
const ( | ||
LFSRequiredFile = ".lfs-required" | ||
LFSConfigFile = ".lfsconfig" | ||
) | ||
|
||
var lfsHooks = [...]string{ | ||
"post-checkout", | ||
"post-commit", | ||
"post-merge", | ||
"pre-push", | ||
} | ||
|
||
// IsLFSAvailable returns 'true' if git-lfs is installed. | ||
func IsLFSAvailable() bool { | ||
_, err := exec.LookPath("git-lfs") | ||
|
||
return err == nil | ||
} | ||
|
||
// IsLFSHook returns whether the hookName is supported by Git LFS. | ||
func IsLFSHook(hookName string) bool { | ||
for _, lfsHookName := range lfsHooks { | ||
if lfsHookName == hookName { | ||
return true | ||
} | ||
} | ||
|
||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters