Hi Carl!
I noticed that in src/git.ts, gitMainWorktree, parseWorktreeList, and listRemotes split git output using \n. On environments where Git outputs CRLF line endings (or when core.autocrlf is enabled), trailing \r characters stay attached to worktree paths, branch names, and remote names.
Because of this:
- staleWorktreeRecord fails the item.worktree === dir check because of the trailing carriage return.
- existsAt(record.worktree) looks for a path containing \r.
- listRemotes produces entries like \origin\r, which breaks
efs/remotes//\ lookups.
Splitting by /\r?\n/ and trimming the parsed values resolves this cleanly. I'll open a pull request with the fix and test cases.
[Deutsche Übersetzung / German translation]
(Hallo Carl! Mir ist aufgefallen, dass in src/git.ts bei gitMainWorktree, parseWorktreeList und listRemotes die Git-Ausgabe mit \n getrennt wird. Auf Systemen, bei denen Git CRLF-Zeilenenden ausgibt, bleibt ein anhängendes \r an Worktree-Pfaden, Branch-Namen und Remote-Namen hängen. Dadurch schlagen Pfadvergleiche und Remote-Lookups fehl. Durch das Aufteilen nach /\r?\n/ und das Trimmen der Werte wird das Problem behoben. Ich reiche dazu gleich einen passenden Pull Request mit Tests ein.)
Hi Carl!
I noticed that in src/git.ts, gitMainWorktree, parseWorktreeList, and listRemotes split git output using \n. On environments where Git outputs CRLF line endings (or when core.autocrlf is enabled), trailing \r characters stay attached to worktree paths, branch names, and remote names.
Because of this:
efs/remotes//\ lookups.
Splitting by /\r?\n/ and trimming the parsed values resolves this cleanly. I'll open a pull request with the fix and test cases.
[Deutsche Übersetzung / German translation]
(Hallo Carl! Mir ist aufgefallen, dass in src/git.ts bei gitMainWorktree, parseWorktreeList und listRemotes die Git-Ausgabe mit \n getrennt wird. Auf Systemen, bei denen Git CRLF-Zeilenenden ausgibt, bleibt ein anhängendes \r an Worktree-Pfaden, Branch-Namen und Remote-Namen hängen. Dadurch schlagen Pfadvergleiche und Remote-Lookups fehl. Durch das Aufteilen nach /\r?\n/ und das Trimmen der Werte wird das Problem behoben. Ich reiche dazu gleich einen passenden Pull Request mit Tests ein.)