Browse Source

A little code reuse

Serj Kalichev 9 years ago
parent
commit
58339a1500
1 changed files with 6 additions and 20 deletions
  1. 6 20
      scripts/rfa

+ 6 - 20
scripts/rfa

@@ -339,34 +339,20 @@ find_repo_root()
 	local r=""
 	local r_root=""
 
-	for r in $possible_vcs; do
-		eval r_root="\$repository_${r}_root"
-		test "x$r_root" = "x" && continue
-		test -d "$r_root/$1" || continue
-		echo "$r_root"
-		break
-	done
-
-	return 0
+	r=`find_repo_vcs "$1"`
+	eval r_root="\$repository_${r}_root"
+	echo "$r_root"
 }
 
 # Find repository link path by repository name
 find_repo_link()
 {
 	local r=""
-	local r_root=""
 	local r_link=""
 
-	for r in $possible_vcs; do
-		eval r_root="\$repository_${r}_root"
-		test "x$r_root" = "x" && continue
-		test -d "$r_root/$1" || continue
-		eval r_link="\$repository_${r}_link"
-		echo "$r_link"
-		break
-	done
-
-	return 0
+	r=`find_repo_vcs "$1"`
+	eval r_link="\$repository_${r}_link"
+	echo "$r_link"
 }
 
 #------------------ MAIN -----------------------------------------