sha1-name: pass len argument to interpret_branch_name()
This is useful to make sure we don't step outside the boundaries of what we are interpreting at the moment. For example while interpreting foobar@{u}~1, the job of interpret_branch_name() ends right before ~1, but there's no way to figure that out inside the function, unless the len argument is passed. So let's do that. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
e230c568c4
commit
cf99a761d3
@ -200,7 +200,7 @@ static void add_pending_object_with_mode(struct rev_info *revs,
|
||||
revs->no_walk = 0;
|
||||
if (revs->reflog_info && obj->type == OBJ_COMMIT) {
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
int len = interpret_branch_name(name, &buf);
|
||||
int len = interpret_branch_name(name, 0, &buf);
|
||||
int st;
|
||||
|
||||
if (0 < len && name[len] && buf.len)
|
||||
|
Reference in New Issue
Block a user