Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.61
3.1.62
11 changes: 11 additions & 0 deletions test/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<bare_repo>/.'" (#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."""
Expand Down
Loading