diff options
Diffstat (limited to 'builtin-commit.c')
-rw-r--r-- | builtin-commit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin-commit.c b/builtin-commit.c index e3564a526..a65c2b8c3 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -175,9 +175,11 @@ static void add_remove_files(struct path_list *list) { int i; for (i = 0; i < list->nr; i++) { + struct stat st; struct path_list_item *p = &(list->items[i]); - if (file_exists(p->path)) - add_file_to_cache(p->path, 0); + + if (!lstat(p->path, &st)) + add_to_cache(p->path, &st, 0); else remove_file_from_cache(p->path); } @@ -745,10 +747,8 @@ static int parse_and_validate_options(int argc, const char *argv[], die("No paths with --include/--only does not make sense."); if (argc == 0 && only && amend) only_include_assumed = "Clever... amending the last one with dirty index."; - if (argc > 0 && !also && !only) { + if (argc > 0 && !also && !only) only_include_assumed = "Explicit paths specified without -i nor -o; assuming --only paths..."; - also = 0; - } if (!cleanup_arg || !strcmp(cleanup_arg, "default")) cleanup_mode = use_editor ? CLEANUP_ALL : CLEANUP_SPACE; else if (!strcmp(cleanup_arg, "verbatim")) @@ -810,7 +810,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1) rev.verbose_header = 1; rev.show_root_diff = 1; - rev.commit_format = get_commit_format("format:%h: %s"); + get_commit_format("format:%h: %s", &rev); rev.always_show_header = 0; rev.diffopt.detect_rename = 1; rev.diffopt.rename_limit = 100; |