GitService.deleteRepository() removes both worktree and git-dir.
Exposed via POST /repo/{name}/delete, a 'Danger Zone' section on
the repo page, and telnet main menu option 4 with confirmation
prompt. Includes unit tests for all layers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
111 lines
2.7 KiB
HTML
111 lines
2.7 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns:th="http://www.thymeleaf.org">
|
|
<head>
|
|
<title th:text="'WebGit - ' + ${name}">WebGit - repo</title>
|
|
</head>
|
|
<body>
|
|
<h1><a href="/">WebGit</a></h1>
|
|
<h2 th:text="${name}">repo</h2>
|
|
|
|
<h3>Branch</h3>
|
|
<table border="0" cellpadding="4" cellspacing="0">
|
|
<tr>
|
|
<td>Current branch:</td>
|
|
<td><b th:text="${currentBranch}"></b></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table border="0" cellpadding="4" cellspacing="0">
|
|
<tr>
|
|
<td>
|
|
<form method="post" th:action="@{/repo/{name}/checkout(name=${name})}">
|
|
Switch to:
|
|
<select name="branch">
|
|
<option th:each="b : ${branches}" th:value="${b}" th:text="${b}" th:selected="${b == currentBranch}"></option>
|
|
</select>
|
|
<input type="submit" value="Checkout">
|
|
</form>
|
|
</td>
|
|
<td>
|
|
<form method="post" th:action="@{/repo/{name}/new-branch(name=${name})}">
|
|
New branch: <input type="text" name="branch" size="20">
|
|
<input type="submit" value="Create">
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<hr>
|
|
|
|
<h3>Modified Files (unstaged)</h3>
|
|
<form method="post" th:action="@{/repo/{name}/stage(name=${name})}" th:if="${!#lists.isEmpty(modifiedFiles)}">
|
|
<table border="1" cellpadding="4" cellspacing="0">
|
|
<tr>
|
|
<th>Stage</th>
|
|
<th>File</th>
|
|
</tr>
|
|
<tr th:each="file : ${modifiedFiles}">
|
|
<td><input type="checkbox" name="files" th:value="${file}"></td>
|
|
<td th:text="${file}"></td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<input type="submit" value="Stage Selected">
|
|
</form>
|
|
<p th:if="${#lists.isEmpty(modifiedFiles)}"><i>No modified files.</i></p>
|
|
|
|
<h3>Staged Files</h3>
|
|
<form method="post" th:action="@{/repo/{name}/unstage(name=${name})}" th:if="${!#lists.isEmpty(stagedFiles)}">
|
|
<table border="1" cellpadding="4" cellspacing="0">
|
|
<tr>
|
|
<th>Unstage</th>
|
|
<th>File</th>
|
|
</tr>
|
|
<tr th:each="file : ${stagedFiles}">
|
|
<td><input type="checkbox" name="files" th:value="${file}"></td>
|
|
<td th:text="${file}"></td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<input type="submit" value="Unstage Selected">
|
|
</form>
|
|
<p th:if="${#lists.isEmpty(stagedFiles)}"><i>No staged files.</i></p>
|
|
|
|
<form method="post" th:action="@{/repo/{name}/commit(name=${name})}" th:if="${!#lists.isEmpty(stagedFiles)}">
|
|
<table border="0" cellpadding="4" cellspacing="0">
|
|
<tr>
|
|
<td>Commit message:</td>
|
|
<td><input type="text" name="message" size="60"></td>
|
|
<td><input type="submit" value="Commit"></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
<hr>
|
|
|
|
<h3>Remote</h3>
|
|
<table border="0" cellpadding="4" cellspacing="0">
|
|
<tr>
|
|
<td>
|
|
<form method="post" th:action="@{/repo/{name}/push(name=${name})}">
|
|
<input type="submit" value="Push">
|
|
</form>
|
|
</td>
|
|
<td>
|
|
<form method="post" th:action="@{/repo/{name}/pull(name=${name})}">
|
|
<input type="submit" value="Pull">
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<hr>
|
|
|
|
<h3>Danger Zone</h3>
|
|
<form method="post" th:action="@{/repo/{name}/delete(name=${name})}">
|
|
<input type="submit" value="Delete Repository">
|
|
</form>
|
|
|
|
</body>
|
|
</html>
|