diff options
Diffstat (limited to 'builtin-commit.c')
-rw-r--r-- | builtin-commit.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin-commit.c b/builtin-commit.c index 0baec6db6a..d75224381b 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -179,9 +179,10 @@ static void add_remove_files(struct path_list *list) struct stat st; struct path_list_item *p = &(list->items[i]); - if (!lstat(p->path, &st)) - add_to_cache(p->path, &st, 0); - else + if (!lstat(p->path, &st)) { + if (add_to_cache(p->path, &st, 0)) + die("updating files failed"); + } else remove_file_from_cache(p->path); } } @@ -246,7 +247,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix) */ if (all || (also && pathspec && *pathspec)) { int fd = hold_locked_index(&index_lock, 1); - add_files_to_cache(0, also ? prefix : NULL, pathspec); + add_files_to_cache(also ? prefix : NULL, pathspec, 0); refresh_cache(REFRESH_QUIET); if (write_cache(fd, active_cache, active_nr) || close_lock_file(&index_lock)) |