mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-07 03:45:00 +00:00
fix: must convert the relative path to absolute before send it to first instance (#1376)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
dd432c63e8
commit
db5bb0aec9
3 changed files with 14 additions and 4 deletions
|
@ -393,7 +393,17 @@ namespace SourceGit
|
||||||
_ipcChannel = new Models.IpcChannel();
|
_ipcChannel = new Models.IpcChannel();
|
||||||
if (!_ipcChannel.IsFirstInstance)
|
if (!_ipcChannel.IsFirstInstance)
|
||||||
{
|
{
|
||||||
_ipcChannel.SendToFirstInstance(desktop.Args is { Length: 1 } ? desktop.Args[0] : string.Empty);
|
var arg = desktop.Args is { Length: > 0 } ? desktop.Args[0].Trim() : string.Empty;
|
||||||
|
if (!string.IsNullOrEmpty(arg))
|
||||||
|
{
|
||||||
|
if (arg.StartsWith('"') && arg.EndsWith('"'))
|
||||||
|
arg = arg.Substring(1, arg.Length - 2).Trim();
|
||||||
|
|
||||||
|
if (arg.Length > 0 && !Path.IsPathFullyQualified(arg))
|
||||||
|
arg = Path.GetFullPath(arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
_ipcChannel.SendToFirstInstance(arg);
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -220,12 +220,12 @@ namespace SourceGit.Models
|
||||||
public void Complete()
|
public void Complete()
|
||||||
{
|
{
|
||||||
_users.Clear();
|
_users.Clear();
|
||||||
|
|
||||||
All.Complete();
|
All.Complete();
|
||||||
Month.Complete();
|
Month.Complete();
|
||||||
Week.Complete();
|
Week.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly DateTime _thisMonthStart;
|
private readonly DateTime _thisMonthStart;
|
||||||
private readonly DateTime _thisWeekStart;
|
private readonly DateTime _thisWeekStart;
|
||||||
private readonly Dictionary<string, User> _users = new();
|
private readonly Dictionary<string, User> _users = new();
|
||||||
|
|
|
@ -135,7 +135,7 @@ namespace SourceGit.Views
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ToolTip.SetTip(this, TIPS[(int)c.Index]);
|
ToolTip.SetTip(this, TIPS[(int)c.Index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
InvalidateVisual();
|
InvalidateVisual();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue