]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/ref-transaction-hook'
authorJunio C Hamano <gitster@pobox.com>
Mon, 31 Aug 2020 22:49:52 +0000 (15:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 31 Aug 2020 22:49:53 +0000 (15:49 -0700)
Code simplification by removing ineffective optimization.

* ps/ref-transaction-hook:
  refs: remove lookup cache for reference-transaction hook

1  2 
refs.c

diff --cc refs.c
index 6aa4893996076a4c104055e884df2f4720c85dbf,d4ec7d30c126d408ca088f6bdd4e67a227e99dbd..156fdcd459f22b2f9b7c54c5d85afb086c54fe57
--- 1/refs.c
--- 2/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";