Skip to content

Commit

Permalink
common: return default value for __get_remote_[url|revision]
Browse files Browse the repository at this point in the history
When we call __get_remote_url or __get_remote_revision, we should
return None if the key is not found instead of raising an exception.

Signed-off-by: Julien Masson <[email protected]>
  • Loading branch information
massonju committed Sep 17, 2024
1 parent 404c3a6 commit 21cb4cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions repo_resource/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ def __add_remote_revision(self, remote, rev):
self.__remote_revision[remote] = rev

def __get_remote_url(self, remote):
return self.__remote_url[remote]
return self.__remote_url.get(remote, None)

def __get_remote_revision(self, remote):
return self.__remote_revision[remote]
return self.__remote_revision.get(remote, None)

def set_rewrite(self, matrix: dict = None):
if matrix is None:
Expand Down

0 comments on commit 21cb4cf

Please sign in to comment.