X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git.c;h=940a498962ceb06a1dba85547d61ad62bb81a499;hb=1c7c1d179e51f163c014353f33b406f5bae13922;hp=89feb0b6dc9c34902aa7c3c4ac526c646c0e0d84;hpb=46dc1b0e332612aa32c139007fa33f4b429de9d1;p=git.git diff --git a/git.c b/git.c index 89feb0b6d..940a49896 100644 --- a/git.c +++ b/git.c @@ -195,8 +195,8 @@ static int handle_alias(int *argcp, const char ***argv) ret = 1; } - if (subdir) - chdir(subdir); + if (subdir && chdir(subdir)) + die("Cannot change to %s: %s", subdir, strerror(errno)); errno = saved_errno; @@ -266,6 +266,7 @@ static void handle_internal_command(int argc, const char **argv) const char *cmd = argv[0]; static struct cmd_struct commands[] = { { "add", cmd_add, RUN_SETUP | NEED_WORK_TREE }, + { "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE }, { "annotate", cmd_annotate, RUN_SETUP }, { "apply", cmd_apply }, { "archive", cmd_archive },