Skip to content

Commit

Permalink
fix: compare remote branches
Browse files Browse the repository at this point in the history
In the previous release (#34) we compared the remote destination. This works fine but we should compare both repos based on the remote. The pull request is created remote so the pull request description should reflect the remote state.

Issue: #32, #34
  • Loading branch information
Joris Conijn committed Feb 19, 2022
1 parent 4a92af7 commit ee2a135
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pull_request_codecommit/git/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@ def current_branch(self) -> str:
return self.__execute(["branch", "--show-current"])

def get_commit_messages(self, destination_branch: str) -> Commits:
self.fetch()
messages = self.__execute(
["log", f"origin/{destination_branch}..{self.current_branch}"]
["log", f"origin/{destination_branch}..origin/{self.current_branch}"]
)

return Commits(messages)

def checkout(self, destination: str) -> None:
self.__execute(["checkout", destination])

def fetch(self) -> None:
self.__execute(["fetch"])

def pull(self) -> None:
self.__execute(["pull"])

Expand Down

0 comments on commit ee2a135

Please sign in to comment.