summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cache.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/cache.c b/cache.c
index 2c70be7..bb4fc47 100644
--- a/cache.c
+++ b/cache.c
@@ -15,6 +15,7 @@
#include "cgit.h"
#include "cache.h"
+#include "cmd.h"
#include "html.h"
#ifdef HAVE_LINUX_SENDFILE
#include <sys/sendfile.h>
@@ -356,6 +357,7 @@ int cache_process(int size, const char *path, const char *key, int ttl,
struct strbuf filename = STRBUF_INIT;
struct strbuf lockname = STRBUF_INIT;
struct cache_slot slot;
+ struct cgit_cmd *cmd;
int result;
/* If the cache is disabled, just generate the content */
@@ -370,6 +372,15 @@ int cache_process(int size, const char *path, const char *key, int ttl,
fn();
return 0;
}
+
+ cmd = cgit_get_cmd();
+
+ /* Do not cache files that are being cloned */
+ if (cmd && cmd->is_clone) {
+ fn();
+ return 0;
+ }
+
if (!key)
key = "";
hash = hash_str(key) % size;