Thread (30 messages) flat view 30 messages, 4 authors, 2016-06-15

Re: [PATCH 07/13] prune_remote(): use delete_refs()

From: Stefan Beller <hidden>
Date: 2016-06-15 23:05:12

On Mon, Jun 8, 2015 at 4:45 AM, Michael Haggerty [off-list ref] wrote:
This will result in errors being emitted for references that can't be
deleted, but that is a good thing.
This sounds a bit like hand-waving to me. "Trust me, I'm an engineer!".

quoted hunk ↗ jump to hunk
Signed-off-by: Michael Haggerty <redacted>
---
 builtin/remote.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index c8dc724..cc3c741 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1314,19 +1314,12 @@ static int prune_remote(const char *remote, int dry_run)
                string_list_append(&refs_to_prune, item->util);
        string_list_sort(&refs_to_prune);

-       if (!dry_run) {
-               struct strbuf err = STRBUF_INIT;
-               if (repack_without_refs(&refs_to_prune, &err))
-                       result |= error("%s", err.buf);
-               strbuf_release(&err);
-       }
+       if (!dry_run)
+               result |= delete_refs(&refs_to_prune);

        for_each_string_list_item(item, &states.stale) {
                const char *refname = item->util;

-               if (!dry_run)
-                       result |= delete_ref(refname, NULL, 0);
-
                if (dry_run)
                        printf_ln(_(" * [would prune] %s"),
                               abbrev_ref(refname, "refs/remotes/"));
--
2.1.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help