Skip to content

Commit e7ade4f

Browse files
committed
Added author check for sync
1 parent 4e70767 commit e7ade4f

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ ClassMethod UserAction(InternalName As %String, MenuName As %String, ByRef Targe
262262
set Action = 7
263263
quit $$$OK
264264
} elseif (menuItemName = "Commit") {
265-
do ..CheckUserIdentity()
266265
set Target = "Please enter a commit message"
267266
set Action = 7
268267
quit $$$OK
@@ -401,7 +400,10 @@ ClassMethod SyncCommit(Msg As %String) As %Status
401400
set uncommittedFilesWithAction = ##class(SourceControl.Git.Utils).UncommittedWithAction().%Get("user")
402401
set username = ..GitUserName()
403402
set email = ..GitUserEmail()
404-
set author = username_" <"_email_">"
403+
set author = ""
404+
if ((username '= "") && (email '= "")) {
405+
set author = username_" <"_email_">"
406+
}
405407
do ..RunGitWithArgs(.errStream, .outStream, "commit", "--author", author, "-m", Msg)
406408
do ..PrintStreams(errStream, outStream)
407409
$$$QuitOnError(..ClearUncommitted(uncommittedFilesWithAction))
@@ -1798,7 +1800,7 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
17981800
set errStreamLine = errStream.ReadLine()
17991801
if (((errStreamLine = "Committer identity unknown") || (errStreamLine = "Author identity unknown"))) {
18001802
do errStream.Clear()
1801-
do errStream.WriteLine("Commit failed as user identity unknown."_$c(13,10)_$c(13,10)_"Go to settings to configure Git committer name and email."_$c(13,10))
1803+
do errStream.WriteLine("Commit failed as user identity unknown."_$c(13,10)_$c(13,10)_"Go to settings."_$c(13,10))
18021804
}
18031805
}
18041806

@@ -2711,14 +2713,4 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
27112713
return sc
27122714
}
27132715

2714-
ClassMethod CheckUserIdentity()
2715-
{
2716-
if ..GitUserName() = "" {
2717-
write !, "WARNING: Git committer name is not configured. Go to settings to configure the committer name."
2718-
}
2719-
if ..GitUserEmail() = "" {
2720-
write !, "WARNING: Git committer email is not configured. Go to settings to configure the committer email."
2721-
}
2722-
}
2723-
27242716
}

0 commit comments

Comments
 (0)