Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Oct 24, 2023
1 parent 7666046 commit 50a78ea
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespaces = true
# ----------------------------------------- Project Metadata -------------------------------------
#
[project]
version = "0.0.0.dev156"
version = "0.0.0.dev157"
name = "RepoDynamics"
dependencies = [
"packaging >= 23.2, < 24",
Expand Down
16 changes: 16 additions & 0 deletions src/repodynamics/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,22 @@ def get_user(
self._logger.error(f"Failed to get {user_type}.{key}.", details=err, exit_code=code)
return tuple(user)

def fetch_all_remote_branches(self):
curr_branch, other_branches = self.get_all_branch_names()
local_branches = [curr_branch] + other_branches
remote_branches = self._run(["git", "branch", "-r"]).splitlines()
for remote_branch in remote_branches:
remote_branch = remote_branch.strip()
if " -> " in remote_branch:
continue
remote_branch = remote_branch.removeprefix("origin/")
if remote_branch in local_branches:
continue
self._run(["git", "branch", "--track", remote_branch, f"origin/{remote_branch}"])
self._run(["git", "fetch", "--all"])
self._run(["git", "pull", "--all"])
return

def get_commits(
self,
revision_range: str | None = None
Expand Down
1 change: 1 addition & 0 deletions src/repodynamics/meta/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ def _package_operating_systems(self):
def _package_releases(self) -> dict[str, list[str | dict[str, str | list[str] | PEP440SemVer]]]:
self._logger.h3("Process metadata: package.releases")
ver_tag_prefix = self._metadata["tag"]["group"]["version"]["prefix"]
self._git.fetch_all_remote_branches()
curr_branch, other_branches = self._git.get_all_branch_names()
release_prefix, dev_prefix = allowed_prefixes = tuple(
self._metadata["branch"]["group"][group_name]["prefix"] for group_name in ["release", "dev"]
Expand Down

0 comments on commit 50a78ea

Please sign in to comment.