git.c: consistently use the term "builtin" instead of "internal command"
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
44484662d8
commit
3f784a4dcb
@ -14,7 +14,7 @@ Git:
|
|||||||
|
|
||||||
. Add the external declaration for the function to `builtin.h`.
|
. Add the external declaration for the function to `builtin.h`.
|
||||||
|
|
||||||
. Add the command to `commands[]` table in `handle_internal_command()`,
|
. Add the command to `commands[]` table in `handle_builtin()`,
|
||||||
defined in `git.c`. The entry should look like:
|
defined in `git.c`. The entry should look like:
|
||||||
|
|
||||||
{ "foo", cmd_foo, <options> },
|
{ "foo", cmd_foo, <options> },
|
||||||
|
14
git.c
14
git.c
@ -332,7 +332,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_internal_command(int argc, const char **argv)
|
static void handle_builtin(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char *cmd = argv[0];
|
const char *cmd = argv[0];
|
||||||
static struct cmd_struct commands[] = {
|
static struct cmd_struct commands[] = {
|
||||||
@ -517,8 +517,8 @@ static int run_argv(int *argcp, const char ***argv)
|
|||||||
int done_alias = 0;
|
int done_alias = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
/* See if it's an internal command */
|
/* See if it's a builtin */
|
||||||
handle_internal_command(*argcp, *argv);
|
handle_builtin(*argcp, *argv);
|
||||||
|
|
||||||
/* .. then try the external ones */
|
/* .. then try the external ones */
|
||||||
execv_dashed_external(*argv);
|
execv_dashed_external(*argv);
|
||||||
@ -563,14 +563,14 @@ int main(int argc, char **av)
|
|||||||
* - cannot execute it externally (since it would just do
|
* - cannot execute it externally (since it would just do
|
||||||
* the same thing over again)
|
* the same thing over again)
|
||||||
*
|
*
|
||||||
* So we just directly call the internal command handler, and
|
* So we just directly call the builtin handler, and die if
|
||||||
* die if that one cannot handle it.
|
* that one cannot handle it.
|
||||||
*/
|
*/
|
||||||
if (starts_with(cmd, "git-")) {
|
if (starts_with(cmd, "git-")) {
|
||||||
cmd += 4;
|
cmd += 4;
|
||||||
argv[0] = cmd;
|
argv[0] = cmd;
|
||||||
handle_internal_command(argc, argv);
|
handle_builtin(argc, argv);
|
||||||
die("cannot handle %s internally", cmd);
|
die("cannot handle %s as a builtin", cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Look for flags.. */
|
/* Look for flags.. */
|
||||||
|
Reference in New Issue
Block a user