diff options
author | Junio C Hamano <gitster@pobox.com> | 2025-08-04 08:10:32 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-08-04 08:10:32 -0700 |
commit | 10be1c41bcf5e7cdcd6968c914a9ffd7ce368dbe (patch) | |
tree | afcfa4fd63a2796d744165616c50d2ddb6eb8251 /refs/ref-cache.c | |
parent | 0dc39a6e833dc526d0e5b1c09a01efde98bb70ee (diff) | |
parent | 444ad14e02edc59e61f7d53ae3b9f8ebe90860fd (diff) |
Merge branch 'kn/for-each-ref-skip-updates'
Code clean-up.
* kn/for-each-ref-skip-updates:
ref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'
t6302: add test combining '--start-after' with '--exclude'
for-each-ref: reword the documentation for '--start-after'
for-each-ref: fix documentation argument ordering
ref-cache: use 'size_t' instead of int for length
Diffstat (limited to 'refs/ref-cache.c')
-rw-r--r-- | refs/ref-cache.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/refs/ref-cache.c b/refs/ref-cache.c index ceef3a2008..c180e0aad7 100644 --- a/refs/ref-cache.c +++ b/refs/ref-cache.c @@ -498,13 +498,14 @@ static int cache_ref_iterator_seek(struct ref_iterator *ref_iterator, * indexing to each level as needed. */ do { - int len, idx; + int idx; + size_t len; int cmp = 0; sort_ref_dir(dir); slash = strchr(slash, '/'); - len = slash ? slash - refname : (int)strlen(refname); + len = slash ? (size_t)(slash - refname) : strlen(refname); for (idx = 0; idx < dir->nr; idx++) { cmp = strncmp(refname, dir->entries[idx]->name, len); |