浏览代码

A little code reuse

Serj Kalichev 9 年之前
父节点
当前提交
58339a1500
共有 1 个文件被更改,包括 6 次插入20 次删除
  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 -----------------------------------------