Skip to content

Commit

Permalink
Merge branch 'rs/fetch-simplify-with-starts-with'
Browse files Browse the repository at this point in the history
Code simplification.

* rs/fetch-simplify-with-starts-with:
  fetch: convert strncmp() with strlen() to starts_with()
  • Loading branch information
gitster committed Mar 5, 2024
2 parents 74522bb + 87bd7fb commit 6f74483
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions builtin/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,8 @@ static void filter_prefetch_refspec(struct refspec *rs)
continue;
if (!rs->items[i].dst ||
(rs->items[i].src &&
!strncmp(rs->items[i].src,
ref_namespace[NAMESPACE_TAGS].ref,
strlen(ref_namespace[NAMESPACE_TAGS].ref)))) {
starts_with(rs->items[i].src,
ref_namespace[NAMESPACE_TAGS].ref))) {
int j;

free(rs->items[i].src);
Expand Down

0 comments on commit 6f74483

Please sign in to comment.