home
readme
diff
tree
note
docs
0commit 9ca32a0c65ded8ac61c2ce38b1a8c6899a1678ee
1Author: lakefox <mason@lakefox.net>
2Date: Sat May 23 14:43:52 2026 -0600
3
4 Adding full repo extraction
5
6diff --git a/cgi-bin/cgi.awk b/cgi-bin/cgi.awk
7index 7580f32..5a7027a 100755
8--- a/cgi-bin/cgi.awk
9+++ b/cgi-bin/cgi.awk
10@@ -14,7 +14,7 @@ BEGIN {
11 } else if (kv[1] == "path") {
12 path = sanitize(kv[2])
13 } else {
14- params[kv[1]] = sanitize(kv[2])
15+ params[kv[1]] = kv[2]
16 }
17 }
18
19@@ -22,8 +22,8 @@ BEGIN {
20 if (hash == "") hash = "HEAD"
21
22 query_args = ""
23- for (p in params) query_args = query_args p "=" params[p] " "
24-
25+ for (p in params) query_args = query_args "export " p "=\"" params[p] "\" && "
26+
27 file = "/tmp/" name "/" hash "/" path
28
29 if (system("test -x " file) != 0) {
30@@ -34,16 +34,17 @@ BEGIN {
31 dir_path = dir_path "/" parts[i]
32 }
33
34- system("mkdir -p " dir_path)
35- system("git --git-dir=/var/git/" name ".git/ show " hash ":" path " > " file)
36- system("chmod +x " file)
37- }
38+ system("mkdir -p /tmp/" name "/" hash)
39+
40+ system("git --git-dir=/var/git/" name ".git/ archive " hash " | tar -x -C /tmp/" name "/" hash)
41+ }
42
43 cmd = query_args " " file
44- while ((cmd | getline line) > 0) {
45- print line
46- }
47- close(cmd)
48+
49+ while ((cmd | getline line) > 0) {
50+ print line
51+ }
52+ close(cmd)
53 }
54
55