diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-09-23 13:44:48 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-23 13:44:48 -0700 |
commit | bd42622e5f3ea4a5b1f5fd69174bc7914d00ea3e (patch) | |
tree | 0596aa9f814a7c4d87aa3d56e5349b17391fd491 /builtin | |
parent | Merge branch 'cb/unix-sockets-with-windows' (diff) | |
parent | help: make sure local html page exists before calling external processes (diff) | |
download | tgif-bd42622e5f3ea4a5b1f5fd69174bc7914d00ea3e.tar.xz |
Merge branch 'ma/help-w-check-for-requested-page'
The error in "git help no-such-git-command" is handled better.
* ma/help-w-check-for-requested-page:
help: make sure local html page exists before calling external processes
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/help.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/help.c b/builtin/help.c index b7eec06c3d..7731659765 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -467,11 +467,14 @@ static void get_html_page_path(struct strbuf *page_path, const char *page) if (!html_path) html_path = to_free = system_path(GIT_HTML_PATH); - /* Check that we have a git documentation directory. */ + /* + * Check that the page we're looking for exists. + */ if (!strstr(html_path, "://")) { - if (stat(mkpath("%s/git.html", html_path), &st) + if (stat(mkpath("%s/%s.html", html_path, page), &st) || !S_ISREG(st.st_mode)) - die("'%s': not a documentation directory.", html_path); + die("'%s/%s.html': documentation file not found.", + html_path, page); } strbuf_init(page_path, 0); |