Merge branch 'jk/clone-post-checkout'
[gitweb.git] / builtin-remote.c
index db18bcfc97f0739c2e77164dc0222148a44c67a6..e171096ece8cd041f7e6a08ca80af444786b50cc 100644 (file)
@@ -484,9 +484,8 @@ static int mv(int argc, const char **argv)
                struct string_list_item *item = remote_branches.items + i;
                int flag = 0;
                unsigned char sha1[20];
-               const char *symref;
 
-               symref = resolve_ref(item->string, sha1, 1, &flag);
+               resolve_ref(item->string, sha1, 1, &flag);
                if (!(flag & REF_ISSYMREF))
                        continue;
                if (delete_ref(item->string, NULL, REF_NODEREF))
@@ -756,12 +755,17 @@ static int prune(int argc, const char **argv)
                OPT_END()
        };
        struct ref_states states;
+       const char *dangling_msg;
 
        argc = parse_options(argc, argv, options, builtin_remote_usage, 0);
 
        if (argc < 1)
                usage_with_options(builtin_remote_usage, options);
 
+       dangling_msg = (dry_run
+                       ? " %s will become dangling!\n"
+                       : " %s has become dangling!\n");
+
        memset(&states, 0, sizeof(states));
        for (; argc; argc--, argv++) {
                int i;
@@ -784,6 +788,7 @@ static int prune(int argc, const char **argv)
 
                        printf(" * [%s] %s\n", dry_run ? "would prune" : "pruned",
                               abbrev_ref(refname, "refs/remotes/"));
+                       warn_dangling_symref(dangling_msg, refname);
                }
 
                /* NEEDSWORK: free remote */