list-sources.sh 307 B

123456789101112131415161718
  1. #!/bin/sh
  2. #
  3. # List all the files under version control in the source tree.
  4. #
  5. case $# in
  6. 0) ;;
  7. 1) cd "$1" ;;
  8. *) echo >&2 "Usage: $0 [top_srcdir]"; exit 2 ;;
  9. esac
  10. if [ -r .git/HEAD ]; then
  11. ${GIT:-git} ls-files
  12. exit 0
  13. fi
  14. echo >&2 'Cannot list sources without some version control system in use.'
  15. exit 1