summaryrefslogtreecommitdiff
path: root/src/refdb_fs.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-02-16 17:11:46 +0000
committerEdward Thomson <ethomson@github.com>2016-02-17 13:10:33 +0000
commit318b825e76a9dc8afefc8274c5271747ad64d5a9 (patch)
tree3d800c50d67c7ed818060da8d155f1c006b62f00 /src/refdb_fs.c
parent4fea9cffbda89562bfdcdd58b0162d31ca4feb3e (diff)
downloadlibgit2-318b825e76a9dc8afefc8274c5271747ad64d5a9.tar.gz
index: allow read of index w/ illegal entries
Allow `git_index_read` to handle reading existing indexes with illegal entries. Allow the low-level `git_index_add` to add properly formed `git_index_entry`s even if they contain paths that would be illegal for the current filesystem (eg, `AUX`). Continue to disallow `git_index_add_bypath` from adding entries that are illegal universally illegal (eg, `.git`, `foo/../bar`).
Diffstat (limited to 'src/refdb_fs.c')
-rw-r--r--src/refdb_fs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index 85b5034d6..1348c67a1 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -717,7 +717,7 @@ static int loose_lock(git_filebuf *file, refdb_fs_backend *backend, const char *
assert(file && backend && name);
- if (!git_path_isvalid(backend->repo, name, GIT_PATH_REJECT_DEFAULTS)) {
+ if (!git_path_isvalid(backend->repo, name, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) {
giterr_set(GITERR_INVALID, "Invalid reference name '%s'.", name);
return GIT_EINVALIDSPEC;
}
@@ -1672,7 +1672,7 @@ static int lock_reflog(git_filebuf *file, refdb_fs_backend *backend, const char
repo = backend->repo;
- if (!git_path_isvalid(backend->repo, refname, GIT_PATH_REJECT_DEFAULTS)) {
+ if (!git_path_isvalid(backend->repo, refname, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) {
giterr_set(GITERR_INVALID, "Invalid reference name '%s'.", refname);
return GIT_EINVALIDSPEC;
}