Make diff binary cofigurable
Make diff binary cofigurable

--- a/config/gitphp.conf.php
+++ b/config/gitphp.conf.php
@@ -29,6 +29,13 @@
  * use the executable name to search the user's $PATH.
  */
 $gitphp_conf['gitbin'] = "/usr/bin/git";
+
+/*
+ * diffbin
+ * Path to diff binary
+ * Same rules as gitbin
+ */
+$gitphp_conf['diffbin'] = "/usr/bin/diff";
 
 /*
  * gittmp

--- a/include/gitutil.git_diff_print.php
+++ b/include/gitutil.git_diff_print.php
@@ -23,7 +23,7 @@
 		$to_tmp = $gitphp_conf['gittmp'] . "gitphp_" . $pid . "_to";
 		git_cat_file($proj,$to,$to_tmp);
 	}
-	$diffout = shell_exec("diff -u -p -L '" . $from_name . "' -L '" . $to_name . "' " . $from_tmp . " " . $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 {

comments