From d1a2fed734a761e987ec0b25ac6faf15661b24f2 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 8 Oct 2019 15:40:36 +0200 Subject: [PATCH] gj_common: Avoid returning a NULL shorthand It's not what we expect and was causing crashes on some repos. --- gj_common/gitjournal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gj_common/gitjournal.c b/gj_common/gitjournal.c index 25912e29..9d99352e 100644 --- a/gj_common/gitjournal.c +++ b/gj_common/gitjournal.c @@ -360,7 +360,7 @@ char *gj_branch_name(git_repository *repo) { int err = 0; git_reference *ref = NULL; - char *shorthand = NULL; + char *shorthand = "master"; err = git_repository_head(&ref, repo); if (err < 0)