error_log("how did i end up in clonefrom? $clonefrom");
if(!$isremoteclone) {
exec("/usr/bin/git clone --bare $repo_base/$clonefrom.git $repo_base/$name.git >> /tmp/gitlog 2>&1");
+ gwvpmini_AddRepo($name, $desc, $ownerid, $defperms, $clonefrom);
+ } else {
+ // we do this from an outside call in the background
+ gwvpmini_SendMessage(error, "Cant clone from remote repos yet");
+ return false;
}
} else {
$uid = $_SESSION["id"];
if($rn == false) {
- gwvpmini_SendMessage("error", "local repo $clonefrom given as upstream clone, however $clonefrom doesnt exist on this site (or you cant read it)");
+ gwvpmini_SendMessage("error", "local repo $clonefrom given as upstream clone, however $clonefrom doesnt exist on this site (or you cant read it unbake)");
header("Location: $BASE_URL/repos");
return;
}
// resolve repo permissions on the read/clone
- if(gwvpmini_GetRepoPerm($rn, $uid) < 1) {
- gwvpmini_SendMessage("error", "local repo $clonefrom given as upstream clone, however $clonefrom doesnt exist on this site (or you cant read it)");
+ if(gwvpmini_GetRepoPerm($rn["id"], $uid) < 1) {
+ gwvpmini_SendMessage("error", "local repo $clonefrom given as upstream clone, however $clonefrom doesnt exist on this site (or you cant read it bake)");
header("Location: $BASE_URL/repos");
return;
}
gwvpmini_SendMessage("error", "Repo ".$_REQUEST["reponame"]." already exists");\r
header("Location: $BASE_URL/repos");
} else {
- gwvpmini_createGitRepo($_REQUEST["reponame"], $_SESSION["id"], $_REQUEST["repodesc"], $defperms, $clonefrom, $fromremote);
- gwvpmini_SendMessage("info", "Repo ".$_REQUEST["reponame"]." has been created");
+ if(gwvpmini_createGitRepo($_REQUEST["reponame"], $_SESSION["id"], $_REQUEST["repodesc"], $defperms, $clonefrom, $fromremote)) {
+ gwvpmini_SendMessage("info", "Repo ".$_REQUEST["reponame"]." has been created");
+ }
header("Location: $BASE_URL/repos");
}
} else {