assert($User == $Me || $Me->isPC); Ht::stash_script("peteramati_uservalue=" . json_encode($Me->user_linkpart($User))); $Pset = ContactView::find_pset_redirect(@$_REQUEST["pset"]); $Info = ContactView::user_pset_info($User, $Pset); if (!get($_GET, "commit") || !get($_GET, "commit1") || $Pset->gitless) { $Me->escape(); } $diff_options = ["wdiff" => false]; $hasha = $hashb = $hasha_mine = $hashb_mine = null; $hrecent = $Pset->handout_commits(); if ($hasha = git_commit_in_list($hrecent, $_GET["commit"])) { $diff_options["hasha_hrepo"] = true; } else { $hasha = $hasha_mine = $Info->set_commit($_GET["commit"]); } if ($hashb = git_commit_in_list($hrecent, $_GET["commit1"])) { $diff_options["hashb_hrepo"] = true; } else { $hashb = $hashb_mine = $Info->set_commit($_GET["commit1"]); } if (!$hasha || !$hashb) { if (!$hasha) { $Conf->errorMsg("Commit " . htmlspecialchars($_GET["commit"]) . " is not connected to your repository."); } if (!$hashb) { $Conf->errorMsg("Commit " . htmlspecialchars($_GET["commit1"]) . " is not connected to your repository."); } $Me->escape(); } $diff_options["hasha"] = $hasha; $Conf->header(htmlspecialchars($Pset->title), "home");
public function recent_commits($hash = null) { if ($this->recent_commits === false) { $this->load_recent_commits(); } if (!$hash) { return $this->recent_commits; } if (strlen($hash) != 40) { $hash = git_commit_in_list($this->recent_commits, $hash); } if ($c = @$this->recent_commits[$hash]) { return $c; } return false; }