optimization: break recursion if .git directory exist release-0.6
authorYigang Wen <yigangx.wen@intel.com>
Mon, 8 Apr 2013 08:11:12 +0000 (16:11 +0800)
committerYigang Wen <yigangx.wen@intel.com>
Mon, 8 Apr 2013 08:11:12 +0000 (16:11 +0800)
without this patch, depanneur will scan all directory to find .git
dir, acturally, that's not needed, if .git exist, all dirs, with
same parent dir of .git, can be skipped.

Change-Id: I934695924edb288d7b3f3a00570b7d6bd341c0ef

depanneur

index 078c420..cffdfc5 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -439,7 +439,10 @@ if ( -d "$packaging_dir" && -d ".git" ) {
 }
 
 sub git_wanted {
-    fill_packs_from_git($name) if /^\.git\z/s && -d $_;
+    if( -d "$name/.git" ){
+        fill_packs_from_git("$name/.git");
+        $prune = 1;
+    }
 }
 
 sub obs_wanted {