fixup! build.cmds.CmdListRepos: Support local repos

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-01-14 19:28:44 +01:00
commit c37e180e00
2 changed files with 4 additions and 7 deletions

View file

@ -35,7 +35,7 @@ build = realpath
build = realpath build = realpath
[pkg.requires.suse] [pkg.requires.suse]
run = python3, python3-GitPython run = python3
release = rpmbuild, pkg-config, python3-base release = rpmbuild, pkg-config, python3-base
[pkg.requires.debian] [pkg.requires.debian]

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import re, git, os import re, os
from argparse import Namespace, ArgumentParser from argparse import Namespace, ArgumentParser
from ..Cmd import Cmd from ..Cmd import Cmd
@ -79,11 +79,8 @@ class CmdListRepos(Cmd): # export
out = [] out = []
for entry in os.scandir(args.base_url + "/" + subdir): for entry in os.scandir(args.base_url + "/" + subdir):
path = entry.path path = entry.path
try: if os.path.isdir(path + "/.git") or os.path.exists(path + "/HEAD"):
_ = git.Repo(path).git_dir out.append(path)
except:
continue
out.append(path)
if out: if out:
print('\n'.join(out)) print('\n'.join(out))
break break