diff mbox series

[v2,3/9] git help: special-case `scalar`

Message ID eb8663e0300784cc211e02b2590d38d4c4ac610b.1662134210.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit dd9603e22822fab19c0557dad0cf1825de325403
Headers show
Series scalar: integrate into core Git | expand

Commit Message

Johannes Schindelin Sept. 2, 2022, 3:56 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

With this commit, `git help scalar` will open the appropriate manual
or HTML page (instead of looking for `gitscalar`).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Victoria Dye <vdye@github.com>
---
 builtin/help.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/builtin/help.c b/builtin/help.c
index 09ac4289f13..6f2796f211e 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -440,6 +440,8 @@  static const char *cmd_to_page(const char *git_cmd)
 		return git_cmd;
 	else if (is_git_command(git_cmd))
 		return xstrfmt("git-%s", git_cmd);
+	else if (!strcmp("scalar", git_cmd))
+		return xstrdup(git_cmd);
 	else
 		return xstrfmt("git%s", git_cmd);
 }