From c2ff262ead80a34bb189bc8aecd5b40591959ae0 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 13 Jan 2013 12:58:22 +0100 Subject: [PATCH] Showing log of initial repo/orphane HEAD did not work Regression introduced in revision 02fbc263b2da8d4cd92e10ff1509dcb277426890. (fixes issue #1590) Signed-off-by: Sven Strickroth --- src/Git/Git.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index abed0fb0e..50bc57241 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -1042,6 +1042,17 @@ int CGit::GetHash(CGitHash &hash, TCHAR* friendname) } gitdirA.ReleaseBuffer(); + int isHeadOrphan = git_repository_head_orphan(repo); + if (isHeadOrphan != 0) + { + git_repository_free(repo); + hash.Empty(); + if (isHeadOrphan == 1) + return 0; + else + return -1; + } + CStringA refnameA = CUnicodeUtils::GetMulti(friendname, CP_UTF8); git_object * gitObject = NULL; -- 2.11.4.GIT