Commit 40306c6
committed
Fix: Prevent git popup when Source Control is disabled (#2138)
Fixed issue where CodeEdit would show "The 'git' command requires the
command line developer tools. Would you like to install the tools now?"
popup on every app launch, even when Source Control was completely
disabled in Settings.
Issue Analysis:
- WorkspaceView.swift was unconditionally calling git operations
(refreshRemotes and refreshStashEntries) on every workspace launch
- These git commands triggered macOS to show the Command Line Developer
Tools installation popup if git wasn't installed
- The operations ran regardless of the sourceControlIsEnabled setting
Solution:
- Added guard statement to check sourceControlIsEnabled before running
git operations in the .task block
- Now git commands only execute when Source Control is enabled in Settings
- Also updated onChange syntax to modern two-parameter form
Result:
- Users who disable Source Control no longer see the git tools popup
- Git operations still work normally when Source Control is enabled
- Popup behavior now respects user preferences as expected
Fixes #21381 parent d0adbb2 commit 40306c6
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
98 | | - | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| |||
0 commit comments