Commit a3df20cf by Carlos Martín Nieto Committed by Patrick Steinhardt

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.
parent a9e60994
...@@ -320,7 +320,7 @@ int git_submodule_lookup( ...@@ -320,7 +320,7 @@ int git_submodule_lookup(
return 0; return 0;
} }
int git_submodule_name_is_valid(const git_repository *repo, const char *name, int flags) int git_submodule_name_is_valid(git_repository *repo, const char *name, int flags)
{ {
git_buf buf = GIT_BUF_INIT; git_buf buf = GIT_BUF_INIT;
int error, isvalid; int error, isvalid;
...@@ -336,8 +336,7 @@ int git_submodule_name_is_valid(const git_repository *repo, const char *name, in ...@@ -336,8 +336,7 @@ int git_submodule_name_is_valid(const git_repository *repo, const char *name, in
git_buf_attach_notowned(&buf, name, strlen(name)); git_buf_attach_notowned(&buf, name, strlen(name));
} }
/* FIXME: Un-consting it to reduce the amount of diff */ isvalid = git_path_isvalid(repo, buf.ptr, 0, flags);
isvalid = git_path_isvalid((git_repository *)repo, buf.ptr, 0, flags);
git_buf_free(&buf); git_buf_free(&buf);
return isvalid; return isvalid;
......
...@@ -159,6 +159,6 @@ extern int git_submodule__map( ...@@ -159,6 +159,6 @@ extern int git_submodule__map(
* @param name the name to check * @param name the name to check
* @param flags the `GIT_PATH` flags to use for the check (0 to use filesystem defaults) * @param flags the `GIT_PATH` flags to use for the check (0 to use filesystem defaults)
*/ */
extern int git_submodule_name_is_valid(const git_repository *repo, const char *name, int flags); extern int git_submodule_name_is_valid(git_repository *repo, const char *name, int flags);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment