MCPcopy
hub / github.com/git-lfs/git-lfs / cmdInstallOptions

Function cmdInstallOptions

commands/command_install.go:37–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35}
36
37func cmdInstallOptions() *lfs.FilterOptions {
38 requireGitVersion()
39
40 if localInstall || worktreeInstall {
41 setupRepository()
42 }
43
44 destArgs := 0
45 if localInstall {
46 destArgs++
47 }
48 if worktreeInstall {
49 destArgs++
50 }
51 if systemInstall {
52 destArgs++
53 }
54 if fileInstall != "" {
55 destArgs++
56 }
57
58 if destArgs > 1 {
59 Exit(tr.Tr.Get("Only one of the --local, --system, --worktree, and --file options can be specified."))
60 }
61
62 // This call will return -1 on Windows; don't warn about this there,
63 // since we can't detect it correctly.
64 uid := os.Geteuid()
65 if systemInstall && uid != 0 && uid != -1 {
66 Print(tr.Tr.Get("warning: current user is not root/admin, system install is likely to fail."))
67 }
68
69 return &lfs.FilterOptions{
70 GitConfig: cfg.GitConfig(),
71 Force: forceInstall,
72 File: fileInstall,
73 Local: localInstall,
74 Worktree: worktreeInstall,
75 System: systemInstall,
76 SkipSmudge: skipSmudgeInstall,
77 }
78}
79
80func installHooksCommand(cmd *cobra.Command, args []string) {
81 updateForce = forceInstall

Callers 2

installCommandFunction · 0.85
uninstallCommandFunction · 0.85

Calls 6

requireGitVersionFunction · 0.85
setupRepositoryFunction · 0.85
ExitFunction · 0.85
PrintFunction · 0.85
GetMethod · 0.65
GitConfigMethod · 0.65

Tested by

no test coverage detected