From cf99a761d3903dbaf8265f60da9eaee6a15a6fe6 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 2 Sep 2013 01:34:29 -0500 Subject: 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 Signed-off-by: Junio C Hamano --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'refs.c') diff --git a/refs.c b/refs.c index 7922261580..8fd5faf8de 100644 --- a/refs.c +++ b/refs.c @@ -1951,7 +1951,7 @@ static int remove_empty_directories(const char *file) static char *substitute_branch_name(const char **string, int *len) { struct strbuf buf = STRBUF_INIT; - int ret = interpret_branch_name(*string, &buf); + int ret = interpret_branch_name(*string, *len, &buf); if (ret == *len) { size_t size; -- cgit v1.2.1