File inc/git.inc.php changed (mode: 100644) (index 06b0b81..fd66798) |
... |
... |
function rg_git_ls_tree($repo_path, $tree, $path) |
455 |
455 |
break; |
break; |
456 |
456 |
} |
} |
457 |
457 |
|
|
|
458 |
|
$a['data'] = trim($a['data']); |
|
459 |
|
if (empty($a['data'])) { |
|
460 |
|
rg_git_set_error("path does not exists"); |
|
461 |
|
break; |
|
462 |
|
} |
|
463 |
|
|
458 |
464 |
$output = explode("\n", trim($a['data'])); |
$output = explode("\n", trim($a['data'])); |
459 |
465 |
$ret = array(); |
$ret = array(); |
460 |
466 |
foreach ($output as $line) { |
foreach ($output as $line) { |
|
467 |
|
//rg_log('DEBUG: processing line [' . $line . ']'); |
461 |
468 |
$_y = array(); |
$_y = array(); |
462 |
469 |
$_t = explode("\t", $line); |
$_t = explode("\t", $line); |
463 |
470 |
$_y['file'] = trim($_t[1]); |
$_y['file'] = trim($_t[1]); |
File inc/user/repo-page.php changed (mode: 100644) (index 969eeef..efbcf25) |
... |
... |
if (strcmp($_subop, "history") == 0) { |
160 |
160 |
$rg['path'] = "/" . $_path; |
$rg['path'] = "/" . $_path; |
161 |
161 |
$_tree = rg_git_ls_tree($repo_path, $ref, $_path); |
$_tree = rg_git_ls_tree($repo_path, $ref, $_path); |
162 |
162 |
if ($_tree === FALSE) { |
if ($_tree === FALSE) { |
163 |
|
$_repo_body .= "Invalid path!"; |
|
|
163 |
|
$_repo_body .= rg_warning('Error: ' . rg_git_error()); |
164 |
164 |
} else { |
} else { |
165 |
165 |
$blob = $_tree[0]; |
$blob = $_tree[0]; |
166 |
166 |
$_hash = $_tree[0]['ref']; |
$_hash = $_tree[0]['ref']; |
|
... |
... |
if (strcmp($_subop, "history") == 0) { |
180 |
180 |
$rg['path'] = "/" . $_path; |
$rg['path'] = "/" . $_path; |
181 |
181 |
$_tree = rg_git_ls_tree($repo_path, $ref, $_path); |
$_tree = rg_git_ls_tree($repo_path, $ref, $_path); |
182 |
182 |
if ($_tree === FALSE) { |
if ($_tree === FALSE) { |
183 |
|
$_repo_body .= "Invalid path!"; |
|
|
183 |
|
$_repo_body .= rg_warning('Error: ' . rg_git_error()); |
184 |
184 |
} else { |
} else { |
185 |
185 |
$_hash = $_tree[0]['ref']; |
$_hash = $_tree[0]['ref']; |
186 |
186 |
$_tree = rg_git_ls_tree($repo_path, $_hash, ""); |
$_tree = rg_git_ls_tree($repo_path, $_hash, ""); |
187 |
|
$_repo_body .= rg_template_table("repo/tree", |
|
188 |
|
$_tree, $rg); |
|
|
187 |
|
if ($_tree === FALSE) |
|
188 |
|
$_repo_body .= rg_warning('Error: ' . rg_git_error()); |
|
189 |
|
else |
|
190 |
|
$_repo_body .= rg_template_table("repo/tree", |
|
191 |
|
$_tree, $rg); |
189 |
192 |
} |
} |
190 |
193 |
} else { // default is to show root tree |
} else { // default is to show root tree |
191 |
194 |
$rg['path'] = ""; |
$rg['path'] = ""; |
192 |
195 |
$_tree = rg_git_ls_tree($repo_path, $ref, ""); |
$_tree = rg_git_ls_tree($repo_path, $ref, ""); |
193 |
|
$_repo_body .= rg_template_table("repo/tree", $_tree, |
|
194 |
|
$rg); |
|
|
196 |
|
if ($_tree === FALSE) |
|
197 |
|
$_repo_body .= rg_warning('Error: ' . rg_git_error()); |
|
198 |
|
else |
|
199 |
|
$_repo_body .= rg_template_table("repo/tree", $_tree, |
|
200 |
|
$rg); |
195 |
201 |
} |
} |
196 |
202 |
} else { // show the log |
} else { // show the log |
197 |
203 |
// TODO: improve the error report (error or empty?) |
// TODO: improve the error report (error or empty?) |