Skip to content

Commit 644f33f

Browse files
committed
Fixed gitconfig not updating symlink origin instead of replacing symlink file
Fixes #245
1 parent 3128341 commit 644f33f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ class SaveAuthorUseCase @Inject constructor() {
1515
repoConfig.load()
1616

1717
if (globalConfig is FileBasedConfig) {
18-
globalConfig.setStringProperty("user", null, "name", newAuthorInfo.globalName)
19-
globalConfig.setStringProperty("user", null, "email", newAuthorInfo.globalEmail)
20-
globalConfig.save()
18+
val canonicalConfigFile = globalConfig.file.canonicalFile
19+
val globalRepoConfig = FileBasedConfig(canonicalConfigFile, git.repository.fs)
20+
21+
globalRepoConfig.setStringProperty("user", null, "name", newAuthorInfo.globalName)
22+
globalRepoConfig.setStringProperty("user", null, "email", newAuthorInfo.globalEmail)
23+
globalRepoConfig.save()
2124
}
2225

2326
config.setStringProperty("user", null, "name", newAuthorInfo.name)

0 commit comments

Comments
 (0)