From: Junio C Hamano Date: Mon, 31 Aug 2020 22:49:52 +0000 (-0700) Subject: Merge branch 'ps/ref-transaction-hook' X-Git-Tag: v2.29.0-rc0~109 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ddd76fd6c356c037b5d5272732900f1f952721e;p=thirdparty%2Fgit.git Merge branch 'ps/ref-transaction-hook' Code simplification by removing ineffective optimization. * ps/ref-transaction-hook: refs: remove lookup cache for reference-transaction hook --- 6ddd76fd6c356c037b5d5272732900f1f952721e diff --cc refs.c index 6aa4893996,d4ec7d30c1..156fdcd459 --- a/refs.c +++ b/refs.c @@@ -1958,18 -1993,14 +1955,14 @@@ static int run_transaction_hook(struct { struct child_process proc = CHILD_PROCESS_INIT; struct strbuf buf = STRBUF_INIT; + const char *hook; int ret = 0, i; - if (hook == &hook_not_found) - return ret; + hook = find_hook("reference-transaction"); if (!hook) - hook = xstrdup_or_null(find_hook("reference-transaction")); - if (!hook) { - hook = &hook_not_found; return ret; - } - argv_array_pushl(&proc.args, hook, state, NULL); + strvec_pushl(&proc.args, hook, state, NULL); proc.in = -1; proc.stdout_to_stderr = 1; proc.trace2_hook_name = "reference-transaction";