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.
 
 

54 lines
1.3 KiB

  1. #!/bin/sh
  2. verifylsremote()
  3. {
  4. fname="$1"
  5. # $ git show-ref gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.6
  6. # 2b3fabd01cec3f6803ec7d255bf0436476c2b812 refs/tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.6
  7. # $ grep '0.6.6$' gm/github.com--lark-parser-lark/2021-09-23T00Z.refs.txt
  8. # 2b3fabd01cec3f6803ec7d255bf0436476c2b812 refs/tags/0.6.6
  9. projname="${fname#gm/}"
  10. projname="${projname%/*}"
  11. date="${fname##*/}"
  12. date="${date%.refs.txt}"
  13. while read hash refname; do
  14. part="${refname##*/}"
  15. header="${refname%/*}"
  16. if [ x"$refname" = x"HEAD" ]; then
  17. continue
  18. fi
  19. if [ x"$header" != x"refs/head" -a x"$header" != x"refs/tags" ]; then
  20. # skipping non-branch, non-tags
  21. continue
  22. fi
  23. read outphash outrefname << INNEREOF
  24. $(git show-ref "gm/$date/$projname/$part")
  25. INNEREOF
  26. if [ x"$outphash" != x"$hash" ]; then
  27. echo "Hash does not match for $refname in $fname:"
  28. echo "$hash != $outphash"
  29. fi
  30. if [ x"${outrefname%/gm/*}" != x"$header" ]; then
  31. echo "Type does not match for $refname in $fname:"
  32. echo "${outrefname%/gm/*} != $header"
  33. fi
  34. if [ x"${outrefname##*/}" != x"$part" ]; then
  35. echo "Name does not match for $refname in $fname:"
  36. echo "${outrefname##*/} != $part"
  37. fi
  38. done <<EOF
  39. $(cat "$fname")
  40. EOF
  41. }
  42. for i in gm/*/*; do
  43. verifylsremote "$i"
  44. done