aboutsummaryrefslogtreecommitdiffstats
path: root/ui-patch.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-patch.c')
-rw-r--r--ui-patch.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui-patch.c b/ui-patch.c
index 36bfae4..c1c4ce3 100644
--- a/ui-patch.c
+++ b/ui-patch.c
@@ -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";