diff options
author | Alex Riesen <raa.lkml@gmail.com> | 2008-05-12 19:57:45 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-05-12 20:54:46 -0700 |
commit | 960b8ad1b1824b1b82c2b09a000c2119f97633a0 (patch) | |
tree | 40cd788ff264c6c81cab6d792068db419b1a7ca1 /builtin-commit.c | |
parent | 64c0d71ce91696dfe5beb4b51e3233e56c857290 (diff) | |
download | git-960b8ad1b1824b1b82c2b09a000c2119f97633a0.tar.gz |
Make the exit code of add_file_to_index actually useful
Update the programs which used the function (as add_file_to_cache).
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r-- | builtin-commit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin-commit.c b/builtin-commit.c index a65c2b8c37..ae29d35d76 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -178,9 +178,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); } } |