From 1d66a8f417c3acead6170c25c34a2c04f26b8ee5 Mon Sep 17 00:00:00 2001 From: Michael Bui Date: Sun, 3 May 2020 15:39:21 +0800 Subject: [PATCH] Use branches in config as prefixes --- bin/repoxplorer-indexer | 2 +- repoxplorer/indexer/git/indexer.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/repoxplorer-indexer b/bin/repoxplorer-indexer index 9a283986..3ff49a6e 100755 --- a/bin/repoxplorer-indexer +++ b/bin/repoxplorer-indexer @@ -108,7 +108,7 @@ def process(conf): if ref.get('index-tags') is True: r.get_tags() if not [head for head in r.heads if - head[1].endswith(ref['branch'])]: + head[1].startswith("refs/heads/%s" % ref['branch'])]: logger.warning( "Repository %s does not have the " "requested branch %s" % (r.base_id, ref['branch'])) diff --git a/repoxplorer/indexer/git/indexer.py b/repoxplorer/indexer/git/indexer.py index 42394f92..ff0168a0 100644 --- a/repoxplorer/indexer/git/indexer.py +++ b/repoxplorer/indexer/git/indexer.py @@ -496,7 +496,7 @@ def git_fetch_branch(self): self.branch)) run(["git", "-c", "credential.helper=%s" % self.credentials_helper_path, - "fetch", "-nk", "origin", "+%s:%s" % (self.branch, self.branch)], + "fetch", "-nk", "--force", "origin", "refs/heads/%s*:refs/heads/%s*" % (self.branch, self.branch)], self.local) def get_refs(self): @@ -543,7 +543,7 @@ def run_workers(self, shas, workers): def is_branch_fully_indexed(self): branch = [head for head in self.heads if - head[1].endswith(self.branch)][0] + head[1].startswith("refs/heads/%s" % self.branch)][0] branch_tip_sha = branch[0] _, _, cmts_list = self.c.get_commits(repos=[self.ref_id], limit=1) if not cmts_list: