diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-25 14:13:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-25 14:13:33 -0700 |
commit | 87492cb24d9d8be8e18217b89ae5f090089ff31d (patch) | |
tree | b517e8efaa98fa713d8b6286ed6ee1c08c385a2e /builtin | |
parent | Merge branch 'mh/update-ref-errors' (diff) | |
parent | for_each_reflog(): reimplement using iterators (diff) | |
download | tgif-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')
-rw-r--r-- | builtin/fetch.c | 2 | ||||
-rw-r--r-- | builtin/remote.c | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index d9ea6f392a..acd0cf1755 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -921,7 +921,7 @@ static int prune_refs(struct refspec *refs, int ref_count, struct ref *ref_map, for (ref = stale_refs; ref; ref = ref->next) string_list_append(&refnames, ref->name); - result = delete_refs(&refnames); + result = delete_refs(&refnames, 0); string_list_clear(&refnames, 0); } diff --git a/builtin/remote.c b/builtin/remote.c index a4d9c1a8e9..9f6a6b3a9c 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; |