ignore gitweb.git in scandir_replace function
authorStricted <Stricted@nexus-irc.de>
Fri, 14 Sep 2012 15:58:55 +0000 (17:58 +0200)
committerStricted <Stricted@nexus-irc.de>
Fri, 14 Sep 2012 15:59:06 +0000 (17:59 +0200)
git_download.php

index 5466c528580f19cec8f906a74acac208ac8b45de..54a506153f93940deda938b130eab0bc7412ccd2 100644 (file)
@@ -70,7 +70,9 @@ if(isset($_GET['p'])){
                        echo '<meta http-equiv="refresh" content="0; URL='.$_SERVER['HTTP_REFERER'].'"> ';
                }else{
                        $b = shell_exec("cd /usr/share/gitweb/dl; git clone git://git.nexus-irc.de/".$_GET['build']);
-                       scandir_replace("/usr/share/gitweb/dl/".$name,"git-".substr($con, 0, -1)."-".substr($hash, 0, -1));
+                       if($_GET['build'] != "gitweb.git") {
+                               scandir_replace("/usr/share/gitweb/dl/".$name,"git-".substr($con, 0, -1)."-".substr($hash, 0, -1));
+                       }
                        $c = shell_exec("cd /usr/share/gitweb/dl; tar czfv ".$name."-".substr($hash, 0, -1).".tar.gz ".$name);
                        $d = shell_exec("rm -r /usr/share/gitweb/dl/".$name);
                        echo '<meta http-equiv="refresh" content="0; URL='.$_SERVER['HTTP_REFERER'].'"> ';
@@ -94,7 +96,9 @@ if(isset($_GET['p'])){
                        $b = shell_exec("cd /usr/share/gitweb/dl/; git clone git://git.nexus-irc.de/".$_GET['build2']);
                        $c = shell_exec("cd /usr/share/gitweb/dl/".$name."/; git reset ".$_GET['h']);
                        $con= shell_exec('git --git-dir=/home/git/'.$_GET['build2'].' rev-list --oneline --header master | wc -l | sed "s/[ \t]//g"');
-                       scandir_replace("/usr/share/gitweb/dl/".$name,"git-".substr($con, 0, -1)."-".$hash);
+                       if($_GET['build2'] != "gitweb.git") {
+                               scandir_replace("/usr/share/gitweb/dl/".$name,"git-".substr($con, 0, -1)."-".$hash);
+                       }
                        $c = shell_exec("cd /usr/share/gitweb/dl; tar czfv ".$name."-".$hash.".tar.gz ".$name);
                        $d = shell_exec("rm -r /usr/share/gitweb/dl/".$name);
                        header("Content-Type: application/x-gzip");