From 2dbe8134bc66a4fea103e09f089a8b9465180592 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Sun, 21 Apr 2013 20:04:00 +0800 Subject: [PATCH] Fixed issue #1750: Repository Browser fails for empty repository Repository Browser should not say error if browsing orphan HEAD, just leave it empty like what Log Dialog does Signed-off-by: Sup Yut Sum --- src/Changelog.txt | 1 + src/TortoiseProc/RepositoryBrowser.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/Changelog.txt b/src/Changelog.txt index f8f618736..0aa743a1e 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -15,6 +15,7 @@ Released: unreleased * Fixed issue #1728: TortoiseGitMerge show fake difference in the same lines if line end falls to 0x40000 byte * Fixed issue #1741: Push / Pull Dialog URL combo box should not be filled unless enabled * Fixed issue #1735: diff-xls.vbs not found + * Fixed issue #1750: Repository Browser fails for empty repository = Release 1.8.2.0 = Released: 2013-03-26 diff --git a/src/TortoiseProc/RepositoryBrowser.cpp b/src/TortoiseProc/RepositoryBrowser.cpp index b4449442e..e1abbd4ad 100644 --- a/src/TortoiseProc/RepositoryBrowser.cpp +++ b/src/TortoiseProc/RepositoryBrowser.cpp @@ -377,6 +377,18 @@ int CRepositoryBrowser::ReadTree(CShadowFilesTree * treeroot) break; } + if (m_sRevision == _T("HEAD")) + { + ret = git_repository_head_orphan(repository); + if (ret == 1) // is orphan + break; + else if (ret != 0) + { + MessageBox(g_Git.GetGitLastErr(_T("Could not check HEAD.")), _T("TortoiseGit"), MB_ICONERROR); + break; + } + } + CGitHash hash; if (g_Git.GetHash(hash, m_sRevision)) { -- 2.11.4.GIT