trace the tree upwards to find .svn or .git