diff options
-rw-r--r-- | ui-clone.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -32,16 +32,22 @@ static int print_ref_info(const char *refname, const unsigned char *sha1, | |||
32 | static void print_pack_info(void) | 32 | static void print_pack_info(void) |
33 | { | 33 | { |
34 | struct packed_git *pack; | 34 | struct packed_git *pack; |
35 | int ofs; | 35 | char *offset; |
36 | 36 | ||
37 | ctx.page.mimetype = "text/plain"; | 37 | ctx.page.mimetype = "text/plain"; |
38 | ctx.page.filename = "objects/info/packs"; | 38 | ctx.page.filename = "objects/info/packs"; |
39 | cgit_print_http_headers(); | 39 | cgit_print_http_headers(); |
40 | ofs = strlen(ctx.repo->path) + strlen("/objects/pack/"); | ||
41 | prepare_packed_git(); | 40 | prepare_packed_git(); |
42 | for (pack = packed_git; pack; pack = pack->next) | 41 | for (pack = packed_git; pack; pack = pack->next) { |
43 | if (pack->pack_local) | 42 | if (pack->pack_local) { |
44 | htmlf("P %s\n", pack->pack_name + ofs); | 43 | offset = strrchr(pack->pack_name, '/'); |
44 | if (offset && offset[1] != '\0') | ||
45 | ++offset; | ||
46 | else | ||
47 | offset = pack->pack_name; | ||
48 | htmlf("P %s\n", offset); | ||
49 | } | ||
50 | } | ||
45 | } | 51 | } |
46 | 52 | ||
47 | static void send_file(char *path) | 53 | static void send_file(char *path) |