gj_common: Avoid returning a NULL shorthand

It's not what we expect and was causing crashes on some repos.
This commit is contained in:
Vishesh Handa
2019-10-08 15:40:36 +02:00
parent 678bf7b879
commit d1a2fed734

View File

@ -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)