Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2008-05-12 21:57:45 +0400
committerJunio C Hamano <gitster@pobox.com>2008-05-13 07:54:46 +0400
commit960b8ad1b1824b1b82c2b09a000c2119f97633a0 (patch)
tree40cd788ff264c6c81cab6d792068db419b1a7ca1 /builtin-commit.c
parent64c0d71ce91696dfe5beb4b51e3233e56c857290 (diff)
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.c7
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);
}
}