Documentation: add missing article in rev-list-options.txt
[gitweb.git] / builtin / remote.c
index 42a533aec300a7a27672724f5b0566728d7b810f..7f28f92a378a4e89d8c938beac23cbe053f1ce33 100644 (file)
@@ -749,13 +749,16 @@ static int mv(int argc, const char **argv)
 
 static int remove_branches(struct string_list *branches)
 {
+       struct strbuf err = STRBUF_INIT;
        const char **branch_names;
        int i, result = 0;
 
        branch_names = xmalloc(branches->nr * sizeof(*branch_names));
        for (i = 0; i < branches->nr; i++)
                branch_names[i] = branches->items[i].string;
-       result |= repack_without_refs(branch_names, branches->nr, NULL);
+       if (repack_without_refs(branch_names, branches->nr, &err))
+               result |= error("%s", err.buf);
+       strbuf_release(&err);
        free(branch_names);
 
        for (i = 0; i < branches->nr; i++) {
@@ -1332,9 +1335,13 @@ static int prune_remote(const char *remote, int dry_run)
                delete_refs = xmalloc(states.stale.nr * sizeof(*delete_refs));
                for (i = 0; i < states.stale.nr; i++)
                        delete_refs[i] = states.stale.items[i].util;
-               if (!dry_run)
-                       result |= repack_without_refs(delete_refs,
-                                                     states.stale.nr, NULL);
+               if (!dry_run) {
+                       struct strbuf err = STRBUF_INIT;
+                       if (repack_without_refs(delete_refs, states.stale.nr,
+                                               &err))
+                               result |= error("%s", err.buf);
+                       strbuf_release(&err);
+               }
                free(delete_refs);
        }