aboutsummaryrefslogtreecommitdiff
path: root/builtin/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-25 14:13:33 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-25 14:13:33 -0700
commit87492cb24d9d8be8e18217b89ae5f090089ff31d (patch)
treeb517e8efaa98fa713d8b6286ed6ee1c08c385a2e /builtin/remote.c
parent702ebbf4e2937accbac8184f87932f961e626a63 (diff)
parent2880d16f09635f9d43247b27fd7e6508b992e599 (diff)
downloadgit-87492cb24d9d8be8e18217b89ae5f090089ff31d.tar.gz
git-87492cb24d9d8be8e18217b89ae5f090089ff31d.tar.xz
Merge branch 'mh/ref-iterators'
The API to iterate over all the refs (i.e. for_each_ref(), etc.) has been revamped. * mh/ref-iterators: for_each_reflog(): reimplement using iterators dir_iterator: new API for iterating over a directory tree for_each_reflog(): don't abort for bad references do_for_each_ref(): reimplement using reference iteration refs: introduce an iterator interface ref_resolves_to_object(): new function entry_resolves_to_object(): rename function from ref_resolves_to_object() get_ref_cache(): only create an instance if there is a submodule remote rm: handle symbolic refs correctly delete_refs(): add a flags argument refs: use name "prefix" consistently do_for_each_ref(): move docstring to the header file refs: remove unnecessary "extern" keywords
Diffstat (limited to 'builtin/remote.c')
-rw-r--r--builtin/remote.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index a4d9c1a8e..9f6a6b3a9 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -539,10 +539,6 @@ static int add_branch_for_removal(const char *refname,
return 0;
}
- /* make sure that symrefs are deleted */
- if (flags & REF_ISSYMREF)
- return unlink(git_path("%s", refname));
-
string_list_append(branches->branches, refname);
return 0;
@@ -788,7 +784,7 @@ static int rm(int argc, const char **argv)
strbuf_release(&buf);
if (!result)
- result = delete_refs(&branches);
+ result = delete_refs(&branches, REF_NODEREF);
string_list_clear(&branches, 0);
if (skipped.nr) {
@@ -1304,7 +1300,7 @@ static int prune_remote(const char *remote, int dry_run)
string_list_sort(&refs_to_prune);
if (!dry_run)
- result |= delete_refs(&refs_to_prune);
+ result |= delete_refs(&refs_to_prune, 0);
for_each_string_list_item(item, &states.stale) {
const char *refname = item->util;