Skip to content

Commit 2b3f23b

Browse files
jayatheerthkulkarnigitster
authored andcommitted
Docs: Correct cmd_psuh and Explain UNUSED macro
The `cmd_psuh` function signature in the documentation, was missing the `struct repository *repo` argument, which is standard for built-in commands. This commit corrects the signature to include the `repo` argument. Additionally, this commit adds an explanation, for using the `UNUSED` macro to prevent compiler warnings. This helps new contributors understand, common practices in the Git codebase. Signed-off-by: K Jayatheerth <[email protected]>
1 parent a8c8147 commit 2b3f23b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Documentation/MyFirstContribution.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,15 @@ command in `builtin/psuh.c`. Create that file, and within it, write the entry
142142
point for your command in a function matching the style and signature:
143143

144144
----
145-
int cmd_psuh(int argc, const char **argv, const char *prefix)
145+
int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo)
146+
----
147+
148+
We also use the UNUSED macro to make sure we don't recieve compiler warnings
149+
for unused arguments from the function cmd_psuh.
150+
151+
----
152+
int cmd_psuh(int argc UNUSED, const char **argv UNUSED,
153+
const char *prefix UNUSED, struct repository *repo UNUSED)
146154
----
147155

148156
We'll also need to add the declaration of psuh; open up `builtin.h`, find the

0 commit comments

Comments
 (0)