This was categorized wrong
This was categorized wrong

--- a/include/display.git_blobdiff.php
+++ b/include/display.git_blobdiff.php
@@ -9,7 +9,7 @@
 
  include_once('util.prep_tmpdir.php');
  include_once('gitutil.git_read_commit.php');
- include_once('gitutil.git_diff_print.php');
+ include_once('display.git_diff_print.php');
 
 function git_blobdiff($projectroot,$project,$hash,$hashbase,$hashparent,$file)
 {

--- a/include/display.git_blobdiff_plain.php
+++ b/include/display.git_blobdiff_plain.php
@@ -8,7 +8,7 @@
  */
 
  include_once('util.prep_tmpdir.php');
- include_once('gitutil.git_diff_print.php');
+ include_once('display.git_diff_print.php');
 
 function git_blobdiff_plain($projectroot,$project,$hash,$hashbase,$hashparent,$file)
 {

--- a/include/display.git_commitdiff.php
+++ b/include/display.git_commitdiff.php
@@ -11,8 +11,8 @@
  include_once('util.prep_tmpdir.php');
  include_once('gitutil.git_read_commit.php');
  include_once('gitutil.git_diff_tree.php');
- include_once('gitutil.git_diff_print.php');
  include_once('gitutil.read_info_ref.php');
+ include_once('display.git_diff_print.php');
 
 function git_commitdiff($projectroot,$project,$hash,$hash_parent)
 {

--- a/include/display.git_commitdiff_plain.php
+++ b/include/display.git_commitdiff_plain.php
@@ -12,8 +12,8 @@
  include_once('gitutil.git_read_commit.php');
  include_once('gitutil.git_diff_tree.php');
  include_once('gitutil.git_rev_list.php');
- include_once('gitutil.git_diff_print.php');
  include_once('gitutil.read_info_ref.php');
+ include_once('display.git_diff_print.php');
 
 function git_commitdiff_plain($projectroot,$project,$hash,$hash_parent)
 {

--- /dev/null
+++ b/include/display.git_diff_print.php
@@ -1,1 +1,70 @@
+<?php
+/*
+ *  display.git_diff_print.php
+ *  gitphp: A PHP git repository browser
+ *  Component: Display - print a diff
+ *
+ *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
+ */
 
+ include_once('gitutil.git_cat_file.php');
+
+function git_diff_print($proj,$from,$from_name,$to,$to_name,$format = "html")
+{
+	global $gitphp_conf,$tpl;
+	$from_tmp = "/dev/null";
+	$to_tmp = "/dev/null";
+	if (function_exists('posix_getpid'))
+		$pid = posix_getpid();
+	else
+		$pid = rand();
+	if (isset($from)) {
+		$from_tmp = $gitphp_conf['gittmp'] . "gitphp_" . $pid . "_from";
+		git_cat_file($proj,$from,$from_tmp);
+	}
+	if (isset($to)) {
+		$to_tmp = $gitphp_conf['gittmp'] . "gitphp_" . $pid . "_to";
+		git_cat_file($proj,$to,$to_tmp);
+	}
+	$diffout = shell_exec($gitphp_conf['diffbin'] . " -u -p -L '" . $from_name . "' -L '" . $to_name . "' " . $from_tmp . " " . $to_tmp);
+	if ($format == "plain")
+		echo $diffout;
+	else {
+		$line = strtok($diffout,"\n");
+		while ($line !== false) {
+			$start = substr($line,0,1);
+			unset($color);
+			if ($start == "+")
+				$color = "#008800";
+			else if ($start == "-")
+				$color = "#cc0000";
+			else if ($start == "@")
+				$color = "#990099";
+			if ($start != "\\") {
+			/*
+				while (($pos = strpos($line,"\t")) !== false) {
+					if ($c = (8 - (($pos - 1) % 8))) {
+						$spaces = "";
+						for ($i = 0; $i < $c; $i++)
+							$spaces .= " ";
+						preg_replace('/\t/',$spaces,$line,1);
+					}
+				}
+			 */
+				$tpl->clear_all_assign();
+				$tpl->assign("line",htmlentities($line));
+				if (isset($color))
+					$tpl->assign("color",$color);
+				$tpl->display("diff_line.tpl");
+			}
+			$line = strtok("\n");
+		}
+	}
+	if (isset($from))
+		unlink($from_tmp);
+	if (isset($to))
+		unlink($to_tmp);
+}
+
+?>
+

--- a/include/gitutil.git_diff_print.php
+++ /dev/null
@@ -1,70 +1,1 @@
-<?php
-/*
- *  gitutil.git_diff_print.php
- *  gitphp: A PHP git repository browser
- *  Component: Display - print a diff
- *
- *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
- */
 
- include_once('gitutil.git_cat_file.php');
-
-function git_diff_print($proj,$from,$from_name,$to,$to_name,$format = "html")
-{
-	global $gitphp_conf,$tpl;
-	$from_tmp = "/dev/null";
-	$to_tmp = "/dev/null";
-	if (function_exists('posix_getpid'))
-		$pid = posix_getpid();
-	else
-		$pid = rand();
-	if (isset($from)) {
-		$from_tmp = $gitphp_conf['gittmp'] . "gitphp_" . $pid . "_from";
-		git_cat_file($proj,$from,$from_tmp);
-	}
-	if (isset($to)) {
-		$to_tmp = $gitphp_conf['gittmp'] . "gitphp_" . $pid . "_to";
-		git_cat_file($proj,$to,$to_tmp);
-	}
-	$diffout = shell_exec($gitphp_conf['diffbin'] . " -u -p -L '" . $from_name . "' -L '" . $to_name . "' " . $from_tmp . " " . $to_tmp);
-	if ($format == "plain")
-		echo $diffout;
-	else {
-		$line = strtok($diffout,"\n");
-		while ($line !== false) {
-			$start = substr($line,0,1);
-			unset($color);
-			if ($start == "+")
-				$color = "#008800";
-			else if ($start == "-")
-				$color = "#cc0000";
-			else if ($start == "@")
-				$color = "#990099";
-			if ($start != "\\") {
-			/*
-				while (($pos = strpos($line,"\t")) !== false) {
-					if ($c = (8 - (($pos - 1) % 8))) {
-						$spaces = "";
-						for ($i = 0; $i < $c; $i++)
-							$spaces .= " ";
-						preg_replace('/\t/',$spaces,$line,1);
-					}
-				}
-			 */
-				$tpl->clear_all_assign();
-				$tpl->assign("line",htmlentities($line));
-				if (isset($color))
-					$tpl->assign("color",$color);
-				$tpl->display("diff_line.tpl");
-			}
-			$line = strtok("\n");
-		}
-	}
-	if (isset($from))
-		unlink($from_tmp);
-	if (isset($to))
-		unlink($to_tmp);
-}
-
-?>
-

comments