From 44b4cbd3cf7e5591cc799f9015a90efae49fadc1 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Mon, 1 Jan 2018 23:28:21 +0100 Subject: [PATCH] Fixed issue #3121: Create shorter branch names when checking out a commit Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/GitSwitchDlg.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 5ba3fae12..c32ec5417 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -9,6 +9,7 @@ Released: unreleased * Fixed issue #3107: Clean: Allow to remove orphaned submodules (i.e., clean -f -f) * Fixed issue #3126: Add an option to show all refs of a commit in the log (all refs are shown now by default) * Fixed issue #3116: Revision graph: add ability to delete branches + * Fixed issue #3121: Create shorter branch names when checking out a commit == Bug Fixes == * Fixed issue #3029: LogDlg: Action column icons painted over Graph or message columns when turned off or resized diff --git a/src/TortoiseProc/GitSwitchDlg.cpp b/src/TortoiseProc/GitSwitchDlg.cpp index 6d01f7887..96b9af911 100644 --- a/src/TortoiseProc/GitSwitchDlg.cpp +++ b/src/TortoiseProc/GitSwitchDlg.cpp @@ -1,6 +1,6 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2008-2017 - TortoiseGit +// Copyright (C) 2008-2018 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -192,6 +192,8 @@ void CGitSwitchDlg::SetDefaultName(BOOL isUpdateCreateBranch) { if (CStringUtils::StartsWith(m_VersionName, L"refs/heads/")) version = m_VersionName.Mid(11); + else + version = version.Left(g_Git.GetShortHASHLength()); m_NewBranch = L"Branch_" + version; this->GetDlgItem(IDC_CHECK_TRACK)->EnableWindow(FALSE); -- 2.11.4.GIT