Commit 8014a357 authored by Yue Lin Ho's avatar Yue Lin Ho

Fixed issue #2604: Tag using TortoiseGitProc.exe /command:tag should accept a tag name argument

Signed-off-by: Yue Lin Ho's avatarYue Lin Ho <b8732003@student.nsysu.edu.tw>
parent 9c4def99
......@@ -604,6 +604,16 @@ Don't touch these lines:
</entry>
</row>
-->
<row>
<entry condition="pot">:tag</entry>
<entry>
Opens the <link linkend="tgit-dug-branchtag">Create Tag dialog</link>. The <option>/path</option> specifies the
repository folder.
Additional options can be set:
<option>/rev:"ref"</option> tags on the specified ref/commit,
<option>/name:"tag_name"</option> fills the Tag name in Create Tag dialog.
</entry>
</row>
</tbody>
</tgroup>
</table>
......
......@@ -11,6 +11,7 @@ Released: unreleased
* Fixed issue #2590: Allow to resolve conflicts with TortoiseGitIDiff by clicking on select
* Added branch revision number for tracking of the source code version of a branch in automated builds using "git rev-list --count --first-parent"
* Allow to choose Git Credential Manager for Windows (GCM)
* Fixed issue #2604: Tag using TortoiseGitProc.exe /command:tag should accept a tag name argument
== Bug Fixes ==
* TortoiseGitMerge highlights wrong line in case of file starts with LF+CRLF
......
......@@ -1185,14 +1185,17 @@ bool CAppUtils::Export(const CString* BashHash, const CTGitPath* orgPath)
return false;
}
bool CAppUtils::CreateBranchTag(bool IsTag, const CString* CommitHash, bool switch_new_brach)
bool CAppUtils::CreateBranchTag(bool isTag /*true*/, const CString* commitHash /*nullptr*/, bool switchNewBranch /*false*/, LPCTSTR name /*nullptr*/)
{
CCreateBranchTagDlg dlg;
dlg.m_bIsTag=IsTag;
dlg.m_bSwitch=switch_new_brach;
dlg.m_bIsTag = isTag;
dlg.m_bSwitch = switchNewBranch;
if(CommitHash)
dlg.m_initialRefName = *CommitHash;
if (commitHash)
dlg.m_initialRefName = *commitHash;
if (name)
dlg.m_BranchTagName = name;
if(dlg.DoModal()==IDOK)
{
......@@ -1207,7 +1210,7 @@ bool CAppUtils::CreateBranchTag(bool IsTag, const CString* CommitHash, bool swit
if(dlg.m_bForce)
force=_T(" -f ");
if(IsTag)
if (isTag)
{
CString sign;
if(dlg.m_bSign)
......@@ -1246,7 +1249,7 @@ bool CAppUtils::CreateBranchTag(bool IsTag, const CString* CommitHash, bool swit
CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);
return FALSE;
}
if( !IsTag && dlg.m_bSwitch )
if (!isTag && dlg.m_bSwitch)
{
// it is a new branch and the user has requested to switch to it
PerformSwitch(dlg.m_BranchTagName);
......
......@@ -155,7 +155,7 @@ public:
bool bCompact = false);
static bool Export(const CString* BashHash = nullptr, const CTGitPath* orgPath = nullptr);
static bool CreateBranchTag(bool IsTag = TRUE, const CString* CommitHash = nullptr, bool switch_new_brach = false);
static bool CreateBranchTag(bool isTag = true, const CString* commitHash = nullptr, bool switchNewBranch = false, LPCTSTR name = nullptr);
static bool Switch(const CString& initialRefName = CString());
static bool PerformSwitch(const CString& ref, bool bForce = false, const CString& sNewBranch = CString(), bool bBranchOverride = false, BOOL bTrack = 2, bool bMerge = false);
......
......@@ -29,5 +29,5 @@ bool TagCommand::Execute()
if(base.IsEmpty())
p=NULL;
return CAppUtils::CreateBranchTag(TRUE,p);
return CAppUtils::CreateBranchTag(true, p, false, parser.HasVal(L"name") ? parser.GetVal(L"name") : nullptr);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment