update-repo 496 B

123456789101112131415161718
  1. #!/bin/bash
  2. . ./config.sh || ( echo "cannot load config.sh" ; exit 1 )
  3. if [ -d "$TESTFARM_REPO_DIR" ]; then
  4. echo "Repos already initialized. Remove $TESTFARM_REPO_DIR to force reinit"
  5. cd $TESTFARM_REPO_DIR || ( echo "cannot change to $TESTFARM_REPO_DIR" ; exit 2 )
  6. git remote update --prune
  7. git reflog expire --expire=0
  8. # git gc
  9. # git prune
  10. else
  11. mkdir $TESTFARM_REPO_DIR
  12. cd $TESTFARM_REPO_DIR
  13. git init
  14. cp ../git.config .git/config
  15. git remote update
  16. fi