diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..ee4ef9d95 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,14 @@ +# Commit messages + +Every commit must have a descriptive title and a substantive body. Title-only +commit messages are not acceptable. + +The body must explain the problem or motivation, what changed, and why the +chosen approach addresses it. Include relevant behavior before and after the +change, design decisions, limitations, and validation results. Scale the detail +to the change; do not add boilerplate or claim checks that were not run. + +Commit messages must stand on their own. Put the information needed to understand +and review the change in the commit body, even when it also appears in a pull +request description. PR and issue links may provide additional context, but must +not substitute for that explanation. diff --git a/VERSION b/VERSION index c29b32b56..4eb2ee669 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.61 +3.1.62 diff --git a/test/test_repo.py b/test/test_repo.py index ad1fa68ab..b7b5718ff 100644 --- a/test/test_repo.py +++ b/test/test_repo.py @@ -1476,6 +1476,17 @@ def test_git_work_tree_from_bare_repo(self, rw_dir): assert not repo.bare assert osp.samefile(repo.working_tree_dir, worktree_path) + # Discovering from a subdirectory (as tools such as mkdocs plugins do) and then + # running a command with an absolute pathspec must use the worktree, not the + # bare common dir, as the working directory; 3.1.61 failed here with + # "is outside repository at '/.'" (#2223). + subdir = osp.join(worktree_path, "git", "repo") + sub_repo = Repo(subdir, search_parent_directories=True) + assert not sub_repo.bare + assert osp.samefile(sub_repo.working_dir, worktree_path) + expected = repo.git.log("-n", "1", "--format=%H", "--", "git/repo") + assert sub_repo.git.log("-n", "1", "--format=%H", "--", subdir) == expected + def test_git_work_tree_dotgit_relative(self): """Check that we find .git as a worktree file containing a relative path and find the worktree based on it."""