aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/repos23
1 files changed, 5 insertions, 18 deletions
diff --git a/bin/repos b/bin/repos
index 1e764ca..32fe1cd 100755
--- a/bin/repos
+++ b/bin/repos
@@ -131,26 +131,13 @@ shift $((OPTIND - 1))
is_repository() {
- if [ -e "$1"/.git ]; then
- printf 'git:%s\n' "$1"
- return 0
- elif [ -e "$1"/.hg ]; then
- printf 'mercurial:%s\n' "$1"
- return 0
- elif [ -e "$1"/.bk ]; then
- printf 'bitkeeper:%s\n' "$1"
- return 0
- elif [ -e "$1"/_darcs ]; then
- printf 'darcs:%s\n' "$1"
- return 0
- elif [ -e "$1"/CVS/ ]; then
- printf 'cvs:%s\n' "$1"
- return 0
- elif [ -e "$1"/.fslckout ]; then
- printf 'fossil:%s\n' "$1"
+ TYPE="$(vcs -C "$1" -t)"
+ if [ -n "$TYPE" ]; then
+ printf '%s:%s\n' "$TYPE" "$1"
return 0
+ else
+ return 1
fi
- return 1
}