aboutsummaryrefslogtreecommitdiff
path: root/string-list.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-04-03 13:01:08 -0700
committerJunio C Hamano <gitster@pobox.com>2026-04-03 13:01:09 -0700
commit0cd4fb9f46eb0ebd0d243a886ce9a52210e0723e (patch)
tree8069cdba6fa414dc0cb1e11c5c7de7446ef6071f /string-list.c
parent4e5821732e684f21a35288d8e67f453ca2595083 (diff)
parent5c58dbc887a1f3530cb29c995f63675beebb22e9 (diff)
downloadgit-0cd4fb9f46eb0ebd0d243a886ce9a52210e0723e.tar.xz
Merge branch 'ar/config-hook-cleanups'
Code clean-up around the recent "hooks defined in config" topic. * ar/config-hook-cleanups: hook: reject unknown hook names in git-hook(1) hook: show disabled hooks in "git hook list" hook: show config scope in git hook list hook: introduce hook_config_cache_entry for per-hook data t1800: add test to verify hook execution ordering hook: make consistent use of friendly-name in docs hook: replace hook_list_clear() -> string_list_clear_func() hook: detect & emit two more bugs hook: rename cb_data_free/alloc -> hook_data_free/alloc hook: fix minor style issues builtin/receive-pack: properly init receive_hook strbuf hook: move unsorted_string_list_remove() to string-list.[ch]
Diffstat (limited to 'string-list.c')
-rw-r--r--string-list.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/string-list.c b/string-list.c
index fffa2ad4b6..d260b873c8 100644
--- a/string-list.c
+++ b/string-list.c
@@ -281,6 +281,15 @@ void unsorted_string_list_delete_item(struct string_list *list, int i, int free_
list->nr--;
}
+void unsorted_string_list_remove(struct string_list *list, const char *str,
+ int free_util)
+{
+ struct string_list_item *item = unsorted_string_list_lookup(list, str);
+ if (item)
+ unsorted_string_list_delete_item(list, item - list->items,
+ free_util);
+}
+
/*
* append a substring [p..end] to list; return number of things it
* appended to the list.