auto-claude: subtask-1-1 - Add filter after map operation to remove empty str (#1466)
Fix incorrect uncommitted file count display after refreshing a task. The issue was that empty strings from .substring(3).trim() operations on short/malformed git status lines were not filtered out, inflating the count. This adds a second filter after the map to remove empty strings: .filter(file => file)
This commit is contained in:
@@ -2413,7 +2413,8 @@ export function registerWorktreeHandlers(
|
||||
uncommittedFiles = gitStatus
|
||||
.split('\n')
|
||||
.filter(line => line.trim())
|
||||
.map(line => line.substring(3).trim()); // Skip 2 status chars + 1 space, trim any trailing whitespace
|
||||
.map(line => line.substring(3).trim()) // Skip 2 status chars + 1 space, trim any trailing whitespace
|
||||
.filter(file => file); // Remove empty strings from short/malformed status lines
|
||||
|
||||
hasUncommittedChanges = uncommittedFiles.length > 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user