ret = 1;
}
- if (subdir)
- chdir(subdir);
+ if (subdir && chdir(subdir))
+ die("Cannot change to %s: %s", subdir, strerror(errno));
errno = saved_errno;
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 },
static void execv_dashed_external(const char **argv)
{
- struct strbuf cmd;
+ struct strbuf cmd = STRBUF_INIT;
const char *tmp;
- strbuf_init(&cmd, 0);
strbuf_addf(&cmd, "git-%s", argv[0]);
/*