path: root/builtin.h
diff options
authorSebastian Schuberth <>2014-01-02 16:17:11 (GMT)
committerJunio C Hamano <>2014-01-06 19:26:31 (GMT)
commitc6127fa3e25551e969d775b0332d37dc84db1969 (patch)
tree7c154b0d3fc8e7a4bd9a19b8cc185297b68b3972 /builtin.h
parenta3c5263438f7c0ff7dd4d0d8ea86ed7a84a32d18 (diff)
builtin/help.c: speed up is_git_command() by checking for builtin commands first
Since 2dce956 is_git_command() is a bit slow as it does file I/O in the call to list_commands_in_dir(). Avoid the file I/O by adding an early check for the builtin commands. Signed-off-by: Sebastian Schuberth <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin.h b/builtin.h
index d4afbfe..c47c110 100644
--- a/builtin.h
+++ b/builtin.h
@@ -27,6 +27,8 @@ extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
extern int textconv_object(const char *path, unsigned mode, const unsigned char *sha1, int sha1_valid, char **buf, unsigned long *buf_size);
+extern int is_builtin(const char *s);
extern int cmd_add(int argc, const char **argv, const char *prefix);
extern int cmd_annotate(int argc, const char **argv, const char *prefix);
extern int cmd_apply(int argc, const char **argv, const char *prefix);