Skip to content

Commit

Permalink
parents is still at the top level in PR commits
Browse files Browse the repository at this point in the history
  • Loading branch information
mumbleskates committed Dec 18, 2021
1 parent 461157a commit 42c35fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unsquash.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ def recreate_commit(commit_json: dict) -> Commit:
"""
date_format = "%Y-%m-%dT%H:%M:%SZ"
commit = Commit()
commit.parents = [p['sha'].encode() for p in commit_json['parents']]
# leftover hack: adapt in case this is a "pull request commit" json object
# instead of a "git commit" json object. they're equally good but the pull
# request ones have a bunch of extra data in them
Expand All @@ -437,7 +438,6 @@ def recreate_commit(commit_json: dict) -> Commit:
commit.commit_time = int(commit_time.timestamp())
commit.commit_timezone = 0
commit.tree = commit_json['tree']['sha'].encode()
commit.parents = [p['sha'].encode() for p in commit_json['parents']]
return commit


Expand Down

0 comments on commit 42c35fc

Please sign in to comment.