aboutsummaryrefslogtreecommitdiffstats
path: root/commands/user_create.go
diff options
context:
space:
mode:
authorAmine <hilalyamine@gmail.com>2019-12-10 20:52:01 +0100
committerGitHub <noreply@github.com>2019-12-10 20:52:01 +0100
commitef6801a37f75fbc5f65b0a5db194b7f88b439e7b (patch)
tree51ef192a080fd02a1230fd7cb7e8566710e006d2 /commands/user_create.go
parentf1ed857cbd3a253d77b31c0c896fdc4ade40844f (diff)
parentda6591e4807d6aec5f230e8a1efad1e2ef686608 (diff)
downloadgit-bug-ef6801a37f75fbc5f65b0a5db194b7f88b439e7b.tar.gz
Merge pull request #273 from MichaelMure/user-create-set
cmd: "user create" only assign the user identity if not set
Diffstat (limited to 'commands/user_create.go')
-rw-r--r--commands/user_create.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/commands/user_create.go b/commands/user_create.go
index 88cc94de..15b9767e 100644
--- a/commands/user_create.go
+++ b/commands/user_create.go
@@ -53,11 +53,18 @@ func runUserCreate(cmd *cobra.Command, args []string) error {
return err
}
- err = backend.SetUserIdentity(id)
+ set, err := backend.IsUserIdentitySet()
if err != nil {
return err
}
+ if !set {
+ err = backend.SetUserIdentity(id)
+ if err != nil {
+ return err
+ }
+ }
+
_, _ = fmt.Fprintln(os.Stderr)
fmt.Println(id.Id())