Repository navigation
Commit 1d20ba7
fix(server): claim a free folder when the generated worktree path is taken
A folder already at a generated worktree path, such as one an earlier
worktree for the same branch left behind, made `git worktree add` fail.
Claim the folder with a non-recursive mkdir, step to a numbered suffix
that replaces trailing hash characters when it exists, and remove the
claimed folder again if the worktree is not created and the folder is
still empty.
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 4d2fab5 commit 1d20ba7
2 files changed
Lines changed: 65 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5052 | 5052 | | |
5053 | 5053 | | |
5054 | 5054 | | |
| 5055 | + | |
| 5056 | + | |
| 5057 | + | |
| 5058 | + | |
| 5059 | + | |
| 5060 | + | |
| 5061 | + | |
| 5062 | + | |
| 5063 | + | |
| 5064 | + | |
| 5065 | + | |
| 5066 | + | |
| 5067 | + | |
| 5068 | + | |
| 5069 | + | |
| 5070 | + | |
| 5071 | + | |
| 5072 | + | |
| 5073 | + | |
| 5074 | + | |
| 5075 | + | |
| 5076 | + | |
| 5077 | + | |
| 5078 | + | |
| 5079 | + | |
| 5080 | + | |
| 5081 | + | |
| 5082 | + | |
| 5083 | + | |
| 5084 | + | |
5055 | 5085 | | |
5056 | 5086 | | |
5057 | 5087 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4254 | 4254 | | |
4255 | 4255 | | |
4256 | 4256 | | |
4257 | | - | |
| 4257 | + | |
| 4258 | + | |
| 4259 | + | |
| 4260 | + | |
| 4261 | + | |
| 4262 | + | |
| 4263 | + | |
| 4264 | + | |
| 4265 | + | |
| 4266 | + | |
| 4267 | + | |
| 4268 | + | |
| 4269 | + | |
| 4270 | + | |
| 4271 | + | |
| 4272 | + | |
| 4273 | + | |
| 4274 | + | |
| 4275 | + | |
| 4276 | + | |
| 4277 | + | |
| 4278 | + | |
| 4279 | + | |
| 4280 | + | |
| 4281 | + | |
| 4282 | + | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
4258 | 4291 | | |
4259 | 4292 | | |
4260 | 4293 | | |
| |||
4447 | 4480 | | |
4448 | 4481 | | |
4449 | 4482 | | |
4450 | | - | |
| 4483 | + | |
4451 | 4484 | | |
4452 | 4485 | | |
4453 | 4486 | | |
| |||
0 commit comments