◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
8 changes: 7 additions & 1 deletion git/repo/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,13 @@ def rev_parse(repo: "Repo", rev: str) -> AnyGitObject:

# Handle type.
if output_type == "commit":
pass # Default.
elif output_type == "tree":
try:
obj = cast(AnyGitObject, obj)
Expand Down
4 changes: 2 additions & 2 deletions test/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,9 @@ def test_rev_parse(self):
# TODO: Dereference tag into a blob 0.1.7^{blob} - quite a special one.
# Needs a tag which points to a blob.

# ref^0 returns commit being pointed to, same with ref~0, and ^{}
tag = rev_parse("0.1.4")
for token in ("~0", "^0", "^{}"):
self.assertEqual(tag.object, rev_parse("0.1.4%s" % token))
# END handle multiple tokens

Expand Down
Toggle all file notes Toggle all file annotations