aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-09-30 23:56:24 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-10-01 20:25:56 +0530
commit98518ca49996d9ecfba06b9b68babc78210ed9d0 (patch)
treee89c1040897ee52c7cbef1dbf244e54f5022ba9f /app/src/main/java
parentcf0d20299d0926acdc72bb827987bc76d550fa0e (diff)
Make unset author/email behavior match Git
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/git/GitCommandExecutor.kt4
1 files changed, 3 insertions, 1 deletions
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()
}
}