aboutsummaryrefslogtreecommitdiff
path: root/dir.c
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 /dir.c
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
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c8
1 files changed, 4 insertions, 4 deletions
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 &&