File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
CodeEdit/Features/Settings/Pages/SourceControlSettings Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,12 @@ class IgnorePatternModel: ObservableObject {
182182
183183 private func writeAllPatterns( ) {
184184 let content = patterns. map ( \. value) . joined ( separator: " \n " )
185+ Task {
186+ let excludesfile : String ? = try await gitConfig. get ( key: " core.excludesfile " )
187+ if excludesfile == " " {
188+ await gitConfig. set ( key: " core.excludesfile " , value: " ~/ \( fileURL. lastPathComponent) " )
189+ }
190+ }
185191 try ? content. write ( to: fileURL, atomically: true , encoding: . utf8)
186192 }
187193
@@ -271,6 +277,6 @@ class IgnorePatternModel: ObservableObject {
271277 func setupGlobalIgnoreFile( ) async {
272278 guard !FileManager. default. fileExists ( atPath: fileURL. path) else { return }
273279 FileManager . default. createFile ( atPath: fileURL. path, contents: nil )
274- await gitConfig. set ( key: " core.excludesfile " , value: fileURL. path , global : true )
280+ await gitConfig. set ( key: " core.excludesfile " , value: " ~/ \( fileURL. lastPathComponent ) " )
275281 }
276282}
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ private extension SourceControlGitView {
157157 // Fallback to `.gitignore_global` in the home directory
158158 fileURL = FileManager . default. homeDirectoryForCurrentUser. appendingPathComponent ( " .gitignore_global " )
159159 // Set the default path in Git config if not set
160- await gitConfig. set ( key: " core.excludesfile " , value: fileURL. path , global : true )
160+ await gitConfig. set ( key: " core.excludesfile " , value: " ~/ \( fileURL. lastPathComponent ) " )
161161 }
162162
163163 // Ensure the file exists
You can’t perform that action at this time.
0 commit comments