summaryrefslogtreecommitdiff
path: root/worktree.h
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2020-06-19 19:35:43 -0400
committerJunio C Hamano <gitster@pobox.com>2020-06-22 10:30:29 -0700
commitd9c54c2bbf684ca3903bc2227c81f657a557d8b8 (patch)
treef92b97425460ce1f035f4c4839e16e46dd441931 /worktree.h
parent810382ed378731314c03627a8a2d8962b814ad17 (diff)
downloadgit-d9c54c2bbf684ca3903bc2227c81f657a557d8b8.tar.gz
worktree: drop get_worktrees() special-purpose sorting option
Of all the clients of get_worktrees(), only "git worktree list" wants the list sorted in a very specific way; other clients simply don't care about the order. Rather than imbuing get_worktrees() with special knowledge about how various clients -- now and in the future -- may want the list sorted, drop the sorting capability altogether and make it the client's responsibility to sort the list if needed. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'worktree.h')
-rw-r--r--worktree.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/worktree.h b/worktree.h
index d242a6e71c..bd2235abe0 100644
--- a/worktree.h
+++ b/worktree.h
@@ -18,17 +18,12 @@ struct worktree {
int lock_reason_valid; /* private */
};
-/* Functions for acting on the information about worktrees. */
-
-#define GWT_SORT_LINKED (1 << 0) /* keeps linked worktrees sorted */
-
/*
* Get the worktrees. The primary worktree will always be the first returned,
- * and linked worktrees will be pointed to by 'next' in each subsequent
- * worktree. No specific ordering is done on the linked worktrees.
+ * and linked worktrees will follow in no particular order.
*
* The caller is responsible for freeing the memory from the returned
- * worktree(s).
+ * worktrees by calling free_worktrees().
*/
struct worktree **get_worktrees(unsigned flags);