about summary refs log tree commit diff
path: root/cgit.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-05-09 00:48:09 +0200
committerLars Hjemli <hjemli@gmail.com>2007-05-09 00:48:09 +0200
commitca8eb8fc8f71ee0a40015c323619f776840b6503 (patch)
treef74a114ba19c215bffe8362bf8e63495155ebef4 /cgit.c
parentui-view: show pathname if specified in querystring (diff)
downloadcgit-pink-ca8eb8fc8f71ee0a40015c323619f776840b6503.tar.gz
cgit-pink-ca8eb8fc8f71ee0a40015c323619f776840b6503.zip
Add support for downloading single blobs
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-rw-r--r--cgit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index 6dddcbb..28bab8d 100644
--- a/cgit.c
+++ b/cgit.c
@@ -79,11 +79,16 @@ static void cgit_print_repo_page(struct cacheitem *item)
 	show_search = 0;
 	setenv("GIT_DIR", cgit_repo->path, 1);
 
-	if (cgit_repo->snapshots && cgit_query_page && 
-	    !strcmp(cgit_query_page, "snapshot")) {
+	if (cgit_query_page) {
+	    if (cgit_repo->snapshots && !strcmp(cgit_query_page, "snapshot")) {
 		cgit_print_snapshot(item, cgit_query_sha1, "zip", 
 				    cgit_repo->url, cgit_query_name);
 		return;
+	    }
+	    if (!strcmp(cgit_query_page, "blob")) {
+		    cgit_print_blob(item, cgit_query_sha1, cgit_query_path);
+		    return;
+	    }
 	}
 
 	if (cgit_query_page && !strcmp(cgit_query_page, "log"))