From 98518ca49996d9ecfba06b9b68babc78210ed9d0 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 30 Sep 2020 23:56:24 +0530 Subject: Make unset author/email behavior match Git Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/src') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt b/app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt index ed5411ac..ef584cf7 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt @@ -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() } } -- cgit v1.2.3