FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

attr: ensure lookups are on repo-relative paths · libgit2/libgit2@9099230 · GitHub

Commit 9099230

Browse files
committed
attr: ensure lookups are on repo-relative paths
Attribute lookups are done on paths relative to the repository. Fail if erroneously presented with an absolute path.
1 parent 109d3a1 commit 9099230

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/attr.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,13 +629,13 @@ static int collect_attr_files(
629629
const char *workdir = git_repository_workdir(repo);
630630
attr_walk_up_info info = { NULL };
631631

632+
GIT_ASSERT(!git_path_is_absolute(path));
633+
632634
if ((error = attr_setup(repo, attr_session, opts)) < 0)
633635
return error;
634636

635637
/* Resolve path in a non-bare repo */
636638
if (workdir != NULL) {
637-
GIT_ASSERT(!git_path_is_absolute(path));
638-
639639
if (!(error = git_repository_workdir_path(&dir, repo, path)))
640640
error = git_path_find_dir(&dir);
641641
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL