diff options
author | Parabola git <git@parabola.nu> | 2021-03-05 01:00:02 +0000 |
---|---|---|
committer | Parabola git <git@parabola.nu> | 2021-03-05 01:00:02 +0000 |
commit | 5a55263b593b2825e4586776e42113d2a7dadb53 (patch) | |
tree | c547b34a9c4d8a49943e540b4aea2c96c1554e60 | |
parent | ad4667dea64db2db0ae61e19f588a4612aba7c94 (diff) |
Update from cron
-rwxr-xr-x | git-shell-commands/ls-repos | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/git-shell-commands/ls-repos b/git-shell-commands/ls-repos index d6b4138..dbb0a98 100755 --- a/git-shell-commands/ls-repos +++ b/git-shell-commands/ls-repos @@ -8,6 +8,8 @@ readonly URL=https://git.parabola.nu/ set -e - -#find . -type f -name 'HEAD' | sed "s|\./\(.*\)/HEAD|${URL}\1|" -find . -type d -name '*.git' | sed "s|\./\(.*\)|${URL}\1|" +for repo in $(find /srv/git -type d -name '*.git') +do [[ "$(cd $repo && git rev-parse --is-bare-repository 2> /dev/null)" == 'true' ]] && \ + [[ -n "$(cat $repo/info/refs 2> /dev/null)" ]] && \ + sed "s|/srv/git/\(.*\)|${URL} \1|" <<<$repo +done |