xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit bb450d8c2e47b30b98f6571ef80ae310387b4823

Improved ls-tree operation a little bit.

Author: Catalin(ux) M. BOIE
Author date (UTC): 2015-06-26 04:07
Committer: Catalin(ux) M. BOIE
Commit date (UTC): 2015-06-26 04:10
Tree: eda2d51ea934bd968d71c7803612fafe3e082844
Parents: c42469d7e9ea84b23776c945cb0dd46ea82a589f
File Lines added Lines deleted
inc/git.inc.php 5 3
inc/user/repo-page.php 1 1
root/themes/default/repo/tree/nodata.html 1 1

File inc/git.inc.php changed (mode: 100644) (index a76f6d6..5a441f9)
... ... function rg_git_update_ref($ref, $old, $new, $reason)
432 432 /* /*
433 433 * Returns a tree (git ls-tree) * Returns a tree (git ls-tree)
434 434 */ */
435 function rg_git_ls_tree($tree, $path)
435 function rg_git_ls_tree($repo_path, $tree, $path)
436 436 { {
437 437 rg_prof_start("git_ls_tree"); rg_prof_start("git_ls_tree");
438 rg_log_enter("rg_git_ls_tree: tree=$tree path=$path");
438 rg_log_enter("rg_git_ls_tree: repo_path=$repo_path"
439 . " tree=$tree path=$path");
439 440
440 441 $ret = FALSE; $ret = FALSE;
441 442 while (1) { while (1) {
 
... ... function rg_git_ls_tree($tree, $path)
445 446 $tree = " HEAD"; $tree = " HEAD";
446 447 } }
447 448
448 $cmd = "git ls-tree --long" . $op . $tree;
449 $cmd = "git --git-dir=" . escapeshellarg($repo_path)
450 . " ls-tree --long" . $op . $tree;
449 451 if (!empty($path)) if (!empty($path))
450 452 $cmd .= " " . escapeshellarg($path); $cmd .= " " . escapeshellarg($path);
451 453 rg_log("DEBUG: cmd=$cmd"); rg_log("DEBUG: cmd=$cmd");

File inc/user/repo-page.php changed (mode: 100644) (index d97eee9..90ae5c1)
... ... if (strcmp($_subop, "history") == 0) {
157 157 // find hash of blob // find hash of blob
158 158 $_path = implode("/", $paras); $_path = implode("/", $paras);
159 159 $rg['path'] = "/" . $_path; $rg['path'] = "/" . $_path;
160 $_tree = rg_git_ls_tree($ref, $_path);
160 $_tree = rg_git_ls_tree($repo_path, $ref, $_path);
161 161 if ($_tree === FALSE) { if ($_tree === FALSE) {
162 162 $_repo_body .= "Invalid path!"; $_repo_body .= "Invalid path!";
163 163 } else { } else {

File root/themes/default/repo/tree/nodata.html changed (mode: 100644) (index fa1a030..b8d96e9)
1 1 <div class="ok"> <div class="ok">
2 Empty tree.
2 Tree is empty or an error occured.
3 3 </div> </div>
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master