summaryrefslogtreecommitdiff
path: root/bin/just-mr.py
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-07-20 16:46:13 +0200
committerOliver Reiche <oliver.reiche@huawei.com>2022-07-20 19:19:57 +0200
commit0cf8dea6f3fac64540cd5e92a8eab7992e9dcc04 (patch)
tree8efd8ce72f2289da15f6179270e0a1a692cedcd1 /bin/just-mr.py
parent3163a2d27808784d78c46f016cca31574a5d7450 (diff)
downloadjustbuild-0cf8dea6f3fac64540cd5e92a8eab7992e9dcc04.tar.gz
just-mr: Fix use of local Git repos with relative path
... by computing the absolute path (required to successfully identified them as a Git root) and enforcing that tag creation is only performed for the default Git root from the cache directory.
Diffstat (limited to 'bin/just-mr.py')
-rwxr-xr-xbin/just-mr.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/just-mr.py b/bin/just-mr.py
index 491c100c..4773e1aa 100755
--- a/bin/just-mr.py
+++ b/bin/just-mr.py
@@ -103,8 +103,13 @@ def git_root(*, upstream):
return os.path.join(ROOT, "git")
+def is_cache_git_root(upstream):
+ """return true if upstream is the default git root in the cache directory"""
+ return git_root(upstream=upstream) == git_root(upstream=None)
+
+
def git_keep(commit, *, upstream):
- if upstream in GIT_CHECKOUT_LOCATIONS:
+ if not is_cache_git_root(upstream):
# for those, we assume the referenced commit is kept by
# some branch anyway
return
@@ -188,6 +193,8 @@ def git_checkout(desc):
if ALWAYS_FILE and os.path.exists(target):
return ["file", subdir_path(target, desc)]
repo = desc["repository"]
+ if git_url_is_path(repo):
+ repo = os.path.abspath(repo)
root = git_root(upstream=repo)
ensure_git(upstream=repo)
if not git_commit_present(commit, upstream=repo):