This fixes two things:
- make sure the first item is always the main worktree even if we
fail to retrieve some info
- keep 'worktree list' order stable (which in turn fixes the random
failure on my 'worktree-move' series
Nguyễn Thái Ngọc Duy (3):
worktree.c: zero new 'struct worktree' on allocation
get_worktrees() must return main worktree as first item even on error
worktree list: keep the list sorted
builtin/worktree.c | 26 ++++++++++++++++++++++----
worktree.c | 20 ++++----------------
2 files changed, 26 insertions(+), 20 deletions(-)
--
2.8.2.524.g6ff3d78