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>
This commit is contained in:
Alex Riesen
2008-05-12 19:57:45 +02:00
committed by Junio C Hamano
parent 64c0d71ce9
commit 960b8ad1b1
4 changed files with 13 additions and 9 deletions

View File

@ -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);
}
}