Skip to content

Commit

Permalink
git checkout某个commit后获取提交id
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Jul 21, 2024
1 parent af4d2e4 commit e695eac
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arknights_mower/utils/git_rev.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ def git_rev(repo):

# Find head file .git/HEAD (e.g. ref: ref/heads/master => .git/ref/heads/master)
if not head_ref.startswith("ref: "):
warn(f"expected 'ref: path/to/head' in {git_head}")
return None
return head_ref
head_ref = head_ref[5:].strip()

# Read commit id from head file
Expand Down

0 comments on commit e695eac

Please sign in to comment.