aboutsummaryrefslogtreecommitdiff
path: root/builtin-add.c
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2008-05-12 19:57:45 +0200
committerJunio C Hamano <gitster@pobox.com>2008-05-12 20:54:46 -0700
commit960b8ad1b1824b1b82c2b09a000c2119f97633a0 (patch)
tree40cd788ff264c6c81cab6d792068db419b1a7ca1 /builtin-add.c
parent64c0d71ce91696dfe5beb4b51e3233e56c857290 (diff)
downloadgit-960b8ad1b1824b1b82c2b09a000c2119f97633a0.tar.gz
git-960b8ad1b1824b1b82c2b09a000c2119f97633a0.tar.xz
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-add.c')
-rw-r--r--builtin-add.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-add.c b/builtin-add.c
index 4a91e3eb1..4d72ab678 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -94,7 +94,8 @@ static void update_callback(struct diff_queue_struct *q,
case DIFF_STATUS_UNMERGED:
case DIFF_STATUS_MODIFIED:
case DIFF_STATUS_TYPE_CHANGED:
- add_file_to_cache(path, verbose);
+ if (add_file_to_cache(path, verbose))
+ die("updating files failed");
break;
case DIFF_STATUS_DELETED:
remove_file_from_cache(path);
@@ -254,7 +255,8 @@ int cmd_add(int argc, const char **argv, const char *prefix)
}
for (i = 0; i < dir.nr; i++)
- add_file_to_cache(dir.entries[i]->name, verbose);
+ if (add_file_to_cache(dir.entries[i]->name, verbose))
+ die("adding files failed");
finish:
if (active_cache_changed) {