~michel-slm/myrepos-utils

bf57cf8989a37ce5fc653c32ce9c9d4166a6a573 — Michel Lind 4 months ago 337bb22
config: fix base case where the repo is not nested

Signed-off-by: Michel Lind <salimma@fedoraproject.org>
1 files changed, 4 insertions(+), 1 deletions(-)

M myrepos_utils/utils.py
M myrepos_utils/utils.py => myrepos_utils/utils.py +4 -1
@@ 86,9 86,12 @@ def config_repo(

    checkout_dirname = os.path.dirname(checkout_dir)
    checkout_basename = os.path.basename(checkout_dir)
    checkout_cmd = ["mr", "-d", checkout_basename, "co"]
    if checkout_dirname:
        pathlib.Path(checkout_dirname).mkdir(parents=True, exist_ok=True)
    res = subprocess.run(["mr", "-d", checkout_basename, "co"], cwd=checkout_dirname)
        res = subprocess.run(checkout_cmd, cwd=checkout_dirname)
    else:
        res = subprocess.run(checkout_cmd)
    return res.returncode