Thread (581 messages) flat view 581 messages, 16 authors, 2021-10-12
STALE1799d

[PATCH v8 34/37] bugreport: use hook_exists instead of find_hook

From: Emily Shaffer <hidden>
Date: 2021-03-11 02:12:41
Subsystem: the rest · Maintainer: Linus Torvalds

By using the helper in hook.h instead of the one in run-command.h, we
can also check whether a hook exists in the config - not just whether it
exists in the hookdir.

Signed-off-by: Emily Shaffer <redacted>
---
 builtin/bugreport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/bugreport.c b/builtin/bugreport.c
index ad3cc9c02f..eac3726527 100644
--- a/builtin/bugreport.c
+++ b/builtin/bugreport.c
@@ -3,7 +3,7 @@
 #include "strbuf.h"
 #include "help.h"
 #include "compat/compiler.h"
-#include "run-command.h"
+#include "hook.h"
 
 
 static void get_system_info(struct strbuf *sys_info)
@@ -82,7 +82,7 @@ static void get_populated_hooks(struct strbuf *hook_info, int nongit)
 	}
 
 	for (i = 0; i < ARRAY_SIZE(hook); i++)
-		if (find_hook(hook[i]))
+		if (hook_exists(hook[i], HOOKDIR_USE_CONFIG))
 			strbuf_addf(hook_info, "%s\n", hook[i]);
 }
 
-- 
2.31.0.rc2.261.g7f71774620-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help