Commit d62bf0bf83df307b81affbf7b576985392203fad

Russell Belfer 2014-01-20T10:15:05

Merge pull request #2063 from linquize/reflog-msg-null git_reflog_entry_message can be null

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/revparse.c b/src/revparse.c
index c120b46..5cce3be 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -168,6 +168,8 @@ static int retrieve_previously_checked_out_branch_or_revision(git_object **out, 
 	for (i = 0; i < numentries; i++) {
 		entry = git_reflog_entry_byindex(reflog, i);
 		msg = git_reflog_entry_message(entry);
+		if (!msg)
+			continue;
 
 		if (regexec(&preg, msg, 2, regexmatches, 0))
 			continue;