Git: Use new AddOn.dirs dictionary mapping instead of old list.

This commit is contained in:
Casper V. Kristensen 2021-03-25 15:18:33 +01:00
parent d08e0bebcc
commit e4618876dc
Signed by: caspervk
GPG key ID: 289CA03790535054

View file

@ -52,12 +52,13 @@ class Git(Provider):
@classmethod @classmethod
def _pull(cls, addon: Addon) -> bool: def _pull(cls, addon: Addon) -> bool:
logger.debug("Git pull %s", addon) logger.debug("Git pull %s", addon)
head = cls._head(addon.dirs[0]) # git doesn't care which AddOn dir, as long as we're in the repo path = next(iter(addon.dirs.values())) # git doesn't care which AddOn dir, as long as we're in the repo
head = cls._head(path)
subprocess.run( subprocess.run(
["git", "pull", "--quiet"], ["git", "pull", "--quiet"],
cwd=str(addon.dirs[0]) cwd=str(path)
) )
return head != cls._head(addon.dirs[0]) return head != cls._head(path)
@classmethod @classmethod
def _head(cls, path: Path) -> bytes: def _head(cls, path: Path) -> bytes: