Skip to content

Commit f6be8c2

Browse files
authored
Apply suggestions from code review
1 parent 760a5ac commit f6be8c2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/libgit2/branch.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int not_a_local_branch(const char *reference_name)
5353
return -1;
5454
}
5555

56-
static bool branch_name_follows_pattern(const char *branch_name)
56+
static bool branch_name_is_valid(const char *branch_name)
5757
{
5858
/*
5959
* Discourage branch name starting with dash,
@@ -84,7 +84,7 @@ static int create_branch(
8484
GIT_ASSERT_ARG(ref_out);
8585
GIT_ASSERT_ARG(git_commit_owner(commit) == repository);
8686

87-
if (!branch_name_follows_pattern(branch_name)) {
87+
if (!branch_name_is_valid(branch_name)) {
8888
git_error_set(GIT_ERROR_REFERENCE, "'%s' is not a valid branch name", branch_name);
8989
error = -1;
9090
goto cleanup;
@@ -808,7 +808,7 @@ int git_branch_name_is_valid(int *valid, const char *name)
808808

809809
*valid = 0;
810810

811-
if (!name || !branch_name_follows_pattern(name))
811+
if (!name || !branch_name_is_valid(name))
812812
goto done;
813813

814814
if ((error = git_str_puts(&ref_name, GIT_REFS_HEADS_DIR)) < 0 ||

src/libgit2/tag.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static int write_tag_annotation(
244244
return -1;
245245
}
246246

247-
static bool tag_name_follows_pattern(const char *tag_name)
247+
static bool tag_name_is_valid(const char *tag_name)
248248
{
249249
/*
250250
* Discourage tag name starting with dash,
@@ -278,7 +278,7 @@ static int git_tag_create__internal(
278278
return -1;
279279
}
280280

281-
if (!tag_name_follows_pattern(tag_name)) {
281+
if (!tag_name_is_valid(tag_name)) {
282282
git_error_set(GIT_ERROR_TAG, "'%s' is not a valid tag name", tag_name);
283283
return -1;
284284
}
@@ -554,7 +554,7 @@ int git_tag_name_is_valid(int *valid, const char *name)
554554

555555
GIT_ASSERT(valid);
556556

557-
if (!name || !tag_name_follows_pattern(name))
557+
if (!name || !tag_name_is_valid(name))
558558
goto done;
559559

560560
if ((error = git_str_puts(&ref_name, GIT_REFS_TAGS_DIR)) < 0 ||

0 commit comments

Comments
 (0)