aboutsummaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-21 14:16:46 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-21 14:16:46 -0700
commit9d880582ee0e63b3865350e90d3576fec55aed20 (patch)
tree09edc39b6918dce863c0e88e4c5508a4f957454b /builtin-commit.c
parent8fe114a6e1d606eb806b3f87b17fc22f106af7b7 (diff)
parentdad25e4a7c34a3ece1355f84b8c4661438754531 (diff)
downloadgit-9d880582ee0e63b3865350e90d3576fec55aed20.tar.gz
git-9d880582ee0e63b3865350e90d3576fec55aed20.tar.xz
Merge branch 'ar/add-unreadable'
* ar/add-unreadable: Add a config option to ignore errors for git-add Add a test for git-add --ignore-errors Add --ignore-errors to git-add to allow it to skip files with read errors Extend interface of add_files_to_cache to allow ignore indexing errors Make the exit code of add_file_to_index actually useful
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index 0baec6db6..d75224381 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))