aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-23 09:20:29 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-23 09:20:29 -0700
commit651847f5bcf468e06f4153a438892e517e005dde (patch)
tree6f9545b1149c1ec895ea906b733e381bf948c6dd
parent6e8d538aab8fe4dd07ba9fb87b5c7edcfa5706ad (diff)
parent02cbae61df7b3493e7f76f8385fc9257de60755f (diff)
downloadgit-651847f5bcf468e06f4153a438892e517e005dde.tar.xz
Merge branch 'cf/constness-fixes'
Small code clean-up around the constness area. * cf/constness-fixes: dir: avoid -Wdiscarded-qualifiers in remove_path() bloom: remove a misleading const qualifier
-rw-r--r--bloom.c4
-rw-r--r--dir.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/bloom.c b/bloom.c
index 77a6fddf72..a805ac0c29 100644
--- a/bloom.c
+++ b/bloom.c
@@ -501,7 +501,7 @@ struct bloom_filter *get_or_compute_bloom_filter(struct repository *r,
struct hashmap_iter iter;
for (i = 0; i < diff_queued_diff.nr; i++) {
- const char *path = diff_queued_diff.queue[i]->two->path;
+ char *path = diff_queued_diff.queue[i]->two->path;
/*
* Add each leading directory of the changed file, i.e. for
@@ -523,7 +523,7 @@ struct bloom_filter *get_or_compute_bloom_filter(struct repository *r,
free(e);
if (!last_slash)
- last_slash = (char*)path;
+ last_slash = path;
*last_slash = '\0';
} while (*path);
diff --git a/dir.c b/dir.c
index 026d8516a9..fcb8f6dd2a 100644
--- a/dir.c
+++ b/dir.c
@@ -3518,15 +3518,15 @@ int get_sparse_checkout_patterns(struct pattern_list *pl)
int remove_path(const char *name)
{
- char *slash;
+ const char *last;
if (unlink(name) && !is_missing_file_error(errno))
return -1;
- slash = strrchr(name, '/');
- if (slash) {
+ last = strrchr(name, '/');
+ if (last) {
char *dirs = xstrdup(name);
- slash = dirs + (slash - name);
+ char *slash = dirs + (last - name);
do {
*slash = '\0';
if (startup_info->original_cwd &&