summaryrefslogtreecommitdiff
path: root/git/repo/fun.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/repo/fun.py')
-rw-r--r--git/repo/fun.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/git/repo/fun.py b/git/repo/fun.py
index 2ca2e3d6..ae35aa81 100644
--- a/git/repo/fun.py
+++ b/git/repo/fun.py
@@ -2,6 +2,7 @@
from __future__ import annotations
import os
import stat
+from pathlib import Path
from string import digits
from git.exc import WorkTreeRepositoryUnsupported
@@ -83,7 +84,7 @@ def find_worktree_git_dir(dotgit: "PathLike") -> Optional[str]:
return None
try:
- lines = open(dotgit, "r").readlines()
+ lines = Path(dotgit).read_text().splitlines()
for key, value in [line.strip().split(": ") for line in lines]:
if key == "gitdir":
return value