From a5ba312538a3ef0e698414bd4d963f22daa2124c Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 25 Aug 2012 21:40:46 +0200 Subject: [PATCH] Fixed issue #1361: git push: Entered source ref is ambiguous Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/Git/Git.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 93d0c611a..3e3039eb7 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -32,6 +32,7 @@ Released: unreleased * Fixed issue #1362: Merge Dialog cannot automatically select the annotated tag * Fixed issue #1357: Cannot add file in submodule * Fixed issue #1343: should not set SCI_SETFONTQUALITY to SC_EFF_QUALITY_LCD_OPTIMIZED which bypasses user preference + * Fixed issue #1361: git push: Entered source ref is ambiguous = Release 1.7.12.0 = Released: 2012-08-10 diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index da959cd95..9bf1123bf 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -1170,7 +1170,9 @@ bool CGit::IsBranchTagNameUnique(const CString& name) { CString output; - int ret = g_Git.Run(_T("git show-ref --tags --heads ") + name, &output, NULL, CP_UTF8); + CString cmd; + cmd.Format(_T("git show-ref --tags --heads refs/heads/%s refs/tags/%s"), name, name); + int ret = g_Git.Run(cmd, &output, NULL, CP_UTF8); if (!ret) { int i = 0, pos = 0; @@ -1200,7 +1202,10 @@ bool CGit::BranchTagExists(const CString& name, bool isBranch /*= true*/) else cmd += _T("--tags "); - int ret = g_Git.Run(cmd + name, &output, NULL, CP_UTF8); + cmd += _T("refs/heads/") + name; + cmd += _T(" refs/tags/") + name; + + int ret = g_Git.Run(cmd, &output, NULL, CP_UTF8); if (!ret) { if (!output.IsEmpty()) -- 2.11.4.GIT