This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/bin/sh
-
- verifylsremote()
- {
- fname="$1"
-
- # $ git show-ref gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.6
- # 2b3fabd01cec3f6803ec7d255bf0436476c2b812 refs/tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.6
- # $ grep '0.6.6$' gm/github.com--lark-parser-lark/2021-09-23T00Z.refs.txt
- # 2b3fabd01cec3f6803ec7d255bf0436476c2b812 refs/tags/0.6.6
-
- projname="${fname#gm/}"
- projname="${projname%/*}"
- date="${fname##*/}"
- date="${date%.refs.txt}"
-
- while read hash refname; do
- part="${refname##*/}"
- header="${refname%/*}"
-
- if [ x"$refname" = x"HEAD" ]; then
- continue
- fi
-
- if [ x"$header" != x"refs/head" -a x"$header" != x"refs/tags" ]; then
- # skipping non-branch, non-tags
- continue
- fi
-
- read outphash outrefname << INNEREOF
- $(git show-ref "gm/$date/$projname/$part")
- INNEREOF
- if [ x"$outphash" != x"$hash" ]; then
- echo "Hash does not match for $refname in $fname:"
- echo "$hash != $outphash"
- fi
- if [ x"${outrefname%/gm/*}" != x"$header" ]; then
- echo "Type does not match for $refname in $fname:"
- echo "${outrefname%/gm/*} != $header"
- fi
- if [ x"${outrefname##*/}" != x"$part" ]; then
- echo "Name does not match for $refname in $fname:"
- echo "${outrefname##*/} != $part"
- fi
-
- done <<EOF
- $(cat "$fname")
- EOF
- }
-
- for i in gm/*/*; do
- verifylsremote "$i"
- done
|