pre-rebase hook: capture documentation in a <<here document
[gitweb.git] / run-command.c
index 7dc8a8e70e172d8a9df293cc40b6071693d49430..574b81d3e82bbe6de31b141c3951ab408daad5e6 100644 (file)
@@ -871,8 +871,14 @@ const char *find_hook(const char *name)
 
        strbuf_reset(&path);
        strbuf_git_path(&path, "hooks/%s", name);
-       if (access(path.buf, X_OK) < 0)
+       if (access(path.buf, X_OK) < 0) {
+#ifdef STRIP_EXTENSION
+               strbuf_addstr(&path, STRIP_EXTENSION);
+               if (access(path.buf, X_OK) >= 0)
+                       return path.buf;
+#endif
                return NULL;
+       }
        return path.buf;
 }