sha1-name: replace unsigned int with option struct
In preparation for a future patch adding a boolean parameter to repo_interpret_branch_name(), which might be easily confused with an existing unsigned int parameter, refactor repo_interpret_branch_name() to take an option struct instead of the unsigned int parameter. The static function interpret_branch_mark() is also updated to take the option struct in preparation for that future patch, since it will also make use of the to-be-introduced boolean parameter. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
47ae905ffb
commit
a4f66a7876
3
refs.c
3
refs.c
@ -601,7 +601,8 @@ static char *substitute_branch_name(struct repository *r,
|
||||
const char **string, int *len)
|
||||
{
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
int ret = repo_interpret_branch_name(r, *string, *len, &buf, 0);
|
||||
struct interpret_branch_name_options options = { 0 } ;
|
||||
int ret = repo_interpret_branch_name(r, *string, *len, &buf, &options);
|
||||
|
||||
if (ret == *len) {
|
||||
size_t size;
|
||||
|
Reference in New Issue
Block a user