Skip to content

Commit c5ddea3

Browse files
committed
Fixed previous gitconfig being lost when changing author
Previous config wasn't loaded and it was overriden by new empty one with just the author info. Fixes #297
1 parent 938b86f commit c5ddea3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/kotlin/com/jetpackduba/gitnuro/git/author/SaveAuthorUseCase.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class SaveAuthorUseCase @Inject constructor() {
1818
val canonicalConfigFile = globalConfig.file.canonicalFile
1919
val globalRepoConfig = FileBasedConfig(canonicalConfigFile, git.repository.fs)
2020

21+
globalRepoConfig.load()
2122
globalRepoConfig.setStringProperty("user", null, "name", newAuthorInfo.globalName)
2223
globalRepoConfig.setStringProperty("user", null, "email", newAuthorInfo.globalEmail)
2324
globalRepoConfig.save()

0 commit comments

Comments
 (0)