verify-submodules-recursive.sh 739 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. if [ ! -f "./submodules-recursive/regular-file.txt" ]; then
  3. echo "Expected regular file does not exist"
  4. exit 1
  5. fi
  6. if [ ! -f "./submodules-recursive/submodule-level-1/submodule-file.txt" ]; then
  7. echo "Expected submodule file does not exist"
  8. exit 1
  9. fi
  10. if [ ! -f "./submodules-recursive/submodule-level-1/submodule-level-2/nested-submodule-file.txt" ]; then
  11. echo "Expected nested submodule file does not exists"
  12. exit 1
  13. fi
  14. echo "Testing persisted credential"
  15. pushd ./submodules-recursive/submodule-level-1/submodule-level-2
  16. git config --local --name-only --get-regexp http.+extraheader && git fetch
  17. if [ "$?" != "0" ]; then
  18. echo "Failed to validate persisted credential"
  19. popd
  20. exit 1
  21. fi
  22. popd