Skip to content

Commit 91a4849

Browse files
committed
submodule: the repostiory for _name_is_valid should not be const
We might modify caches due to us trying to load the configuration to figure out what kinds of filesystem protections we should have.
1 parent 1f570a2 commit 91a4849

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/submodule.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ int git_submodule_lookup(
365365
return 0;
366366
}
367367

368-
int git_submodule_name_is_valid(const git_repository *repo, const char *name, int flags)
368+
int git_submodule_name_is_valid(git_repository *repo, const char *name, int flags)
369369
{
370370
git_buf buf = GIT_BUF_INIT;
371371
int error, isvalid;
@@ -381,8 +381,7 @@ int git_submodule_name_is_valid(const git_repository *repo, const char *name, in
381381
git_buf_attach_notowned(&buf, name, strlen(name));
382382
}
383383

384-
/* FIXME: Un-consting it to reduce the amount of diff */
385-
isvalid = git_path_isvalid((git_repository *)repo, buf.ptr, 0, flags);
384+
isvalid = git_path_isvalid(repo, buf.ptr, 0, flags);
386385
git_buf_free(&buf);
387386

388387
return isvalid;

src/submodule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,6 @@ extern int git_submodule__map(
159159
* @param name the name to check
160160
* @param flags the `GIT_PATH` flags to use for the check (0 to use filesystem defaults)
161161
*/
162-
extern int git_submodule_name_is_valid(const git_repository *repo, const char *name, int flags);
162+
extern int git_submodule_name_is_valid(git_repository *repo, const char *name, int flags);
163163

164164
#endif

0 commit comments

Comments
 (0)