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

View File

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