MCPcopy Index your code
hub / github.com/git-bug/git-bug / LoadBackendEnsureUser

Function LoadBackendEnsureUser

commands/execenv/loading.go:96–110  ·  view source on GitHub ↗

LoadBackendEnsureUser is the same as LoadBackend, but also ensure that the user has configured an identity. Use this pre-run function when an error after using the configured user won't do.

(env *Env)

Source from the content-addressed store, hash-verified

94// an identity. Use this pre-run function when an error after using the configured user won't
95// do.
96func LoadBackendEnsureUser(env *Env) func(*cobra.Command, []string) error {
97 return func(cmd *cobra.Command, args []string) error {
98 err := LoadBackend(env)(cmd, args)
99 if err != nil {
100 return err
101 }
102
103 _, err = identity.GetUserIdentity(env.Repo)
104 if err != nil {
105 return err
106 }
107
108 return nil
109 }
110}
111
112// CloseBackend is a wrapper for a RunE function that will close the Backend properly
113// if it has been opened.

Callers 12

newTermUICommandFunction · 0.92
newBridgePushCommandFunction · 0.92
newUserShowCommandFunction · 0.92
newBugStatusCloseCommandFunction · 0.92
newBugLabelNewCommandFunction · 0.92
newBugNewCommandFunction · 0.92
newBugCommentNewCommandFunction · 0.92
newBugCommentEditCommandFunction · 0.92
newBugRmCommandFunction · 0.92
newBugTitleEditCommandFunction · 0.92
newBugStatusOpenCommandFunction · 0.92

Calls 2

GetUserIdentityFunction · 0.92
LoadBackendFunction · 0.85

Tested by

no test coverage detected