Fixed gitconfig not updating symlink origin instead of replacing symlink file

Fixes #245
This commit is contained in:
Abdelilah El Aissaoui 2024-10-31 01:36:22 +01:00
parent 3128341b93
commit 644f33ff2c
No known key found for this signature in database
GPG Key ID: 7587FC860F594869

View File

@ -15,9 +15,12 @@ class SaveAuthorUseCase @Inject constructor() {
repoConfig.load() repoConfig.load()
if (globalConfig is FileBasedConfig) { if (globalConfig is FileBasedConfig) {
globalConfig.setStringProperty("user", null, "name", newAuthorInfo.globalName) val canonicalConfigFile = globalConfig.file.canonicalFile
globalConfig.setStringProperty("user", null, "email", newAuthorInfo.globalEmail) val globalRepoConfig = FileBasedConfig(canonicalConfigFile, git.repository.fs)
globalConfig.save()
globalRepoConfig.setStringProperty("user", null, "name", newAuthorInfo.globalName)
globalRepoConfig.setStringProperty("user", null, "email", newAuthorInfo.globalEmail)
globalRepoConfig.save()
} }
config.setStringProperty("user", null, "name", newAuthorInfo.name) config.setStringProperty("user", null, "name", newAuthorInfo.name)