Make unset author/email behavior match Git

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-09-30 23:56:24 +05:30
parent cf0d20299d
commit 98518ca499
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -51,8 +51,10 @@ class GitCommandExecutor(
// the previous status will eventually be used to avoid a commit
if (nbChanges > 0) {
withContext(Dispatchers.IO) {
val name = GitSettings.authorName.ifEmpty { "root" }
val email = GitSettings.authorEmail.ifEmpty { "localhost" }
command
.setAuthor(PersonIdent(GitSettings.authorName, GitSettings.authorEmail))
.setAuthor(PersonIdent(name, email))
.call()
}
}