From 4f8d21f09d52f74d906b0e86f5ca99335b9998ec Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Sat, 5 Jul 2014 00:00:04 +0800 Subject: [PATCH] Show depth option only when repository is shallow Signed-off-by: Sup Yut Sum --- src/TortoiseProc/PullFetchDlg.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/TortoiseProc/PullFetchDlg.cpp b/src/TortoiseProc/PullFetchDlg.cpp index ea76f2a55..c260f7f00 100644 --- a/src/TortoiseProc/PullFetchDlg.cpp +++ b/src/TortoiseProc/PullFetchDlg.cpp @@ -183,6 +183,17 @@ BOOL CPullFetchDlg::OnInitDialog() if (g_GitAdminDir.IsBareRepo(g_Git.m_CurrentDir)) this->GetDlgItem(IDC_CHECK_REBASE)->EnableWindow(FALSE); + CAutoRepository repo(g_Git.GetGitRepository()); + if (git_repository_is_shallow(repo)) + { + m_bDepth = TRUE; + UpdateData(FALSE); + } + else + { + GetDlgItem(IDC_CHECK_DEPTH)->ShowWindow(SW_HIDE); + GetDlgItem(IDC_EDIT_DEPTH)->ShowWindow(SW_HIDE); + } OnBnClickedCheckDepth(); m_Other.SetCaseSensitive(TRUE); -- 2.11.4.GIT