Skip to content

Commit 6f74483

Browse files
committed
Merge branch 'rs/fetch-simplify-with-starts-with'
Code simplification. * rs/fetch-simplify-with-starts-with: fetch: convert strncmp() with strlen() to starts_with()
2 parents 74522bb + 87bd7fb commit 6f74483

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

builtin/fetch.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,8 @@ static void filter_prefetch_refspec(struct refspec *rs)
448448
continue;
449449
if (!rs->items[i].dst ||
450450
(rs->items[i].src &&
451-
!strncmp(rs->items[i].src,
452-
ref_namespace[NAMESPACE_TAGS].ref,
453-
strlen(ref_namespace[NAMESPACE_TAGS].ref)))) {
451+
starts_with(rs->items[i].src,
452+
ref_namespace[NAMESPACE_TAGS].ref))) {
454453
int j;
455454

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

0 commit comments

Comments
 (0)