summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2017-06-18 15:39:41 +0200
committerJunio C Hamano <gitster@pobox.com>2017-06-18 22:13:42 -0700
commit03df567fbf6afeca32f6a27d04656c1a3a162453 (patch)
treeec403b5a55fb091c668b88da9c13ae492331381c /revision.c
parentfed6ebebf132eb32478a5cbbebba3760c943970a (diff)
downloadgit-03df567fbf6afeca32f6a27d04656c1a3a162453.tar.gz
for_each_bisect_ref(): don't trim refnames
`for_each_bisect_ref()` is called by `for_each_bad_bisect_ref()` with a term "bad". This used to make it call `for_each_ref_in_submodule()` with a prefix "refs/bisect/bad". But the latter is the name of the reference that is being sought, so the empty string was being passed to the callback as the trimmed refname. Moreover, this questionable practice was turned into an error by b9c8e7f2fb prefix_ref_iterator: don't trim too much, 2017-05-22 It makes more sense (and agrees better with the documentation of `--bisect`) for the callers to receive the full reference names. So * Add a new function, `for_each_fullref_in_submodule()`, to the refs API. This plugs a gap in the existing functionality, analogous to `for_each_fullref_in()` but accepting a `submodule` argument. * Change `for_each_bad_bisect_ref()` to call the new function rather than `for_each_ref_in_submodule()`. * Add a test. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 9c67cb6026..50039c92d6 100644
--- a/revision.c
+++ b/revision.c
@@ -2044,7 +2044,7 @@ static int for_each_bisect_ref(const char *submodule, each_ref_fn fn, void *cb_d
struct strbuf bisect_refs = STRBUF_INIT;
int status;
strbuf_addf(&bisect_refs, "refs/bisect/%s", term);
- status = for_each_ref_in_submodule(submodule, bisect_refs.buf, fn, cb_data);
+ status = for_each_fullref_in_submodule(submodule, bisect_refs.buf, fn, cb_data, 0);
strbuf_release(&bisect_refs);
return status;
}