about summary refs log tree commit diff stats
path: root/bonus/git.cgi
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-07-03 17:35:10 +0200
committerbptato <nincsnevem662@gmail.com>2024-07-03 17:35:10 +0200
commit0a1b012ee8cd6640827995c375d914f3e942132b (patch)
tree0b13ef9426cf488fdce51ab1c3e943596863c1de /bonus/git.cgi
parent350e0e0a678784c408ea039b5e8301d7d102ca08 (diff)
downloadchawan-0a1b012ee8cd6640827995c375d914f3e942132b.tar.gz
git.cgi: add [drop] to stash menu
Diffstat (limited to 'bonus/git.cgi')
-rwxr-xr-xbonus/git.cgi4
1 files changed, 3 insertions, 1 deletions
diff --git a/bonus/git.cgi b/bonus/git.cgi
index a60193ed..a68ce9db 100755
--- a/bonus/git.cgi
+++ b/bonus/git.cgi
@@ -73,6 +73,7 @@ const cgi1 = `${cgi0}&params=show`;
 const cgi2 = `${cgi0}&params=log`;
 const cgi3 = `${cgi0}&params=switch`;
 const cgi4 = `${cgi0}&params=stash%20apply`;
+const cgi5 = `${cgi0}&params=stash%20drop`;
 if (params[0] == "log") {
 	runGitCmd(config, params, /[a-f0-9]{40}/g,
 		x => `<a href='${cgi1}%20${x}'>${x}</a>`)
@@ -84,7 +85,8 @@ if (params[0] == "log") {
 } else if (params[0] == "stash" && params[1] == "list") {
 	runGitCmd(config, params, /^stash@\{([0-9]+)\}/g,
 		(s, n) => `stash@{<a href='${cgi1}%20${s}'>${n}</a>}\
- <form method=POST action='${cgi4}%20${s}'><input type=submit value=apply></form>`);
+ <form method=POST action='${cgi4}%20${s}'><input type=submit value=apply></form>` +
+` <form method=POST action='${cgi5}%20${s}'><input type=submit value=drop></form>`);
 } else {
 	const safeForGet = ["show", "diff", "blame", "status"];
 	if (std.getenv("REQUEST_METHOD") != "POST" &&