summaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-05-21 14:16:46 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-05-21 14:16:46 -0700
commit9d880582ee0e63b3865350e90d3576fec55aed20 (patch)
tree09edc39b6918dce863c0e88e4c5508a4f957454b /builtin-commit.c
parentMerge branch 'ds/branch-auto-rebase' (diff)
parentAdd a config option to ignore errors for git-add (diff)
downloadtgif-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 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))