diff options
Diffstat (limited to 'builtin/add.c')
-rw-r--r-- | builtin/add.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/builtin/add.c b/builtin/add.c index 4b0dd798df..5126d2ede3 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -182,7 +182,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix) git_config(git_diff_basic_config, NULL); /* no "diff" UI options */ if (repo_read_index(the_repository) < 0) - die(_("Could not read the index")); + die(_("could not read the index")); repo_init_revisions(the_repository, &rev, prefix); rev.diffopt.context = 7; @@ -194,22 +194,21 @@ static int edit_patch(int argc, const char **argv, const char *prefix) out = xopen(file, O_CREAT | O_WRONLY | O_TRUNC, 0666); rev.diffopt.file = xfdopen(out, "w"); rev.diffopt.close_file = 1; - if (run_diff_files(&rev, 0)) - die(_("Could not write patch")); + run_diff_files(&rev, 0); if (launch_editor(file, NULL, NULL)) die(_("editing patch failed")); if (stat(file, &st)) - die_errno(_("Could not stat '%s'"), file); + die_errno(_("could not stat '%s'"), file); if (!st.st_size) - die(_("Empty patch. Aborted.")); + die(_("empty patch. aborted")); child.git_cmd = 1; strvec_pushl(&child.args, "apply", "--recount", "--cached", file, NULL); if (run_command(&child)) - die(_("Could not apply '%s'"), file); + die(_("could not apply '%s'"), file); unlink(file); free(file); @@ -232,6 +231,8 @@ static char *chmod_arg; static int ignore_removal_cb(const struct option *opt, const char *arg, int unset) { + BUG_ON_OPT_ARG(arg); + /* if we are told to ignore, we are not adding removals */ *(int *)opt->value = !unset ? 0 : 1; return 0; @@ -567,7 +568,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) finish: if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK | SKIP_IF_UNCHANGED)) - die(_("Unable to write new index file")); + die(_("unable to write new index file")); dir_clear(&dir); clear_pathspec(&pathspec); |