We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 555bef6 commit 67f7ffaCopy full SHA for 67f7ffa
1 file changed
git/refs/symbolic.py
@@ -114,6 +114,13 @@ def abspath(self) -> PathLike:
114
def _get_validated_path(base: PathLike, path: PathLike) -> str:
115
path = os.fspath(path)
116
base_path = os.path.realpath(os.fspath(base))
117
+ cur_path = base_path
118
+ for part in os.path.normpath(path).split(os.sep):
119
+ if part in ("", "."):
120
+ continue
121
+ cur_path = os.path.join(cur_path, part)
122
+ if os.path.islink(cur_path):
123
+ raise ValueError("Reference path %r escapes the repository" % path)
124
abs_path = os.path.realpath(os.path.join(base_path, path))
125
try:
126
common_path = os.path.commonpath([base_path, abs_path])
0 commit comments