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

Function envCommand

commands/command_env.go:11–56  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

9)
10
11func envCommand(cmd *cobra.Command, args []string) {
12 config.ShowConfigWarnings = true
13
14 gitV, err := git.Version()
15 if err != nil {
16 gitV = tr.Tr.Get("Error getting Git version: %s", err.Error())
17 }
18
19 Print(config.VersionDesc)
20 Print(gitV)
21 Print("")
22
23 defaultRemote := ""
24 if cfg.IsDefaultRemote() {
25 defaultRemote = cfg.Remote()
26 endpoint := getAPIClient().Endpoints.Endpoint("download", defaultRemote)
27 if len(endpoint.Url) > 0 {
28 access := getAPIClient().Endpoints.AccessFor(endpoint.Url)
29 Print("Endpoint=%s (auth=%s)", endpoint.Url, access.Mode())
30 if len(endpoint.SSHMetadata.UserAndHost) > 0 {
31 Print(" SSH=%s:%s", endpoint.SSHMetadata.UserAndHost, endpoint.SSHMetadata.Path)
32 }
33 }
34 }
35
36 for _, remote := range cfg.Remotes() {
37 if remote == defaultRemote {
38 continue
39 }
40 remoteEndpoint := getAPIClient().Endpoints.Endpoint("download", remote)
41 remoteAccess := getAPIClient().Endpoints.AccessFor(remoteEndpoint.Url)
42 Print("Endpoint (%s)=%s (auth=%s)", remote, remoteEndpoint.Url, remoteAccess.Mode())
43 if len(remoteEndpoint.SSHMetadata.UserAndHost) > 0 {
44 Print(" SSH=%s:%s", remoteEndpoint.SSHMetadata.UserAndHost, remoteEndpoint.SSHMetadata.Path)
45 }
46 }
47
48 for _, env := range lfs.Environ(cfg, getTransferManifest(), oldEnv) {
49 Print(env)
50 }
51
52 for _, key := range []string{"filter.lfs.process", "filter.lfs.smudge", "filter.lfs.clean"} {
53 value, _ := cfg.Git.Get(key)
54 Print("git config %s = %q", key, value)
55 }
56}
57
58func init() {
59 RegisterCommand("env", envCommand, nil)

Callers

nothing calls this directly

Calls 13

VersionFunction · 0.92
EnvironFunction · 0.92
PrintFunction · 0.85
getAPIClientFunction · 0.85
getTransferManifestFunction · 0.85
IsDefaultRemoteMethod · 0.80
ModeMethod · 0.80
RemotesMethod · 0.80
GetMethod · 0.65
ErrorMethod · 0.65
RemoteMethod · 0.65
EndpointMethod · 0.65

Tested by

no test coverage detected