started diff parser
[phpgitweb.git] / htdocs / pages / commitdiff.class.php
index 0897f5c130754ae24dc45b3f54c9e4d3e65b4ece..e8bb17f6999a3918434312ec41830b970950da0a 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
  */
 
-require_once("pages/commit.class.php");
-
 class page_commitdiff {
     private $page, $phpgitweb;
-       private $commitid;
        
     public function main($phpgitweb, $project) {
                $this->phpgitweb = $phpgitweb;
@@ -29,15 +26,10 @@ class page_commitdiff {
                $project['refs'] = $phpgitweb->get_project_loader()->getProjectRefs($project);
                $phpgitweb->append_header_nav("commit", null, true);
                $phpgitweb->append_title("commit");
+               CommitLoader::parse();
                
                $commit_loader = new CommitLoader($project);
-               
-               if(array_key_exists('h', $_GET))
-                       $commitid = $_GET['h'];
-               else
-                       $commitid = "HEAD";
-               
-               $commit = $commit_loader->load($commitid);
+               $commit = $commit_loader->load();
                if(!$commit)
                        return new ContentProvider('main', 'err404_object');
                
@@ -90,7 +82,7 @@ class page_commitdiff {
                $difftree->push_difftree_data($diff_data['tree']);
                $this->page->set('difftree', $difftree->generate_difftree($project, $commit, true));
                
-               
+               $this->page->set('patchset', diff::generate_html($commit, $diff_data));
                
                return $this->page;
        }