diff options
Diffstat (limited to 'ui-patch.c')
-rw-r--r-- | ui-patch.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -90,7 +90,11 @@ void cgit_print_patch(char *hex) | |||
90 | return; | 90 | return; |
91 | } | 91 | } |
92 | info = cgit_parse_commit(commit); | 92 | info = cgit_parse_commit(commit); |
93 | hashcpy(old_sha1, commit->parents->item->object.sha1); | 93 | |
94 | if (commit->parents && commit->parents->item) | ||
95 | hashcpy(old_sha1, commit->parents->item->object.sha1); | ||
96 | else | ||
97 | hashclr(old_sha1); | ||
94 | 98 | ||
95 | patchname = fmt("%s.patch", sha1_to_hex(sha1)); | 99 | patchname = fmt("%s.patch", sha1_to_hex(sha1)); |
96 | ctx.page.mimetype = "text/plain"; | 100 | ctx.page.mimetype = "text/plain"; |