It looks like top_commit_of_remote_branch doesn't work properly for one specific repo state.
This is the state where I found the issue:
local:
commit 90372b08456673748b303147965f36bb01427126 (HEAD -> master, origin/master)
origin:
commit 9faf537d797381aaab997c6e75ab6f5ded506320 (HEAD -> master)
commit 90372b08456673748b303147965f36bb01427126
and the outputs of two commands that fetch top/last remote commit:
repo.get_last_remote_commit(repo.get_remote_url()) -> 9faf537d797381aaab997c6e75ab6f5ded506320repo.top_commit_of_remote_branch(repo.default_branch) -> 90372b08456673748b303147965f36bb01427126
These are the steps to recreate the issue:
Create two commits on local repo and push them to origin
Reset local repo back to the first commit (reset_to_commit)
Try to get top commit with top_commit_of_remote_branch and with get_last_remote_commit and notice the difference.
Do we even need both of these functions if they are supposed to do the same thing?
It looks like
top_commit_of_remote_branch
doesn't work properly for one specific repo state.This is the state where I found the issue:
local:
commit 90372b08456673748b303147965f36bb01427126 (HEAD -> master, origin/master)origin:
commit 9faf537d797381aaab997c6e75ab6f5ded506320 (HEAD -> master) commit 90372b08456673748b303147965f36bb01427126and the outputs of two commands that fetch top/last remote commit:
repo.get_last_remote_commit(repo.get_remote_url())
->9faf537d797381aaab997c6e75ab6f5ded506320
repo.top_commit_of_remote_branch(repo.default_branch)
->90372b08456673748b303147965f36bb01427126
These are the steps to recreate the issue:
reset_to_commit
)top_commit_of_remote_branch
and withget_last_remote_commit
and notice the difference.Do we even need both of these functions if they are supposed to do the same thing?