Make the exit code of add_file_to_index actually useful
[gitweb.git] / builtin-commit.c
index a65c2b8c37c2f7785d76ec1f4e3692ee52dab8e9..ae29d35d76a602d520752801c6a1b6ebfcb9ae7a 100644 (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);
        }
 }