mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 22:01:10 +08:00
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -58,7 +58,7 @@ namespace SourceGit.ViewModels
|
||||
|
||||
var succ = false;
|
||||
var needPopStash = false;
|
||||
|
||||
|
||||
if (!DiscardLocalChanges)
|
||||
{
|
||||
var changes = await new Commands.CountLocalChangesWithoutUntracked(_repo.FullPath).GetResultAsync();
|
||||
@@ -77,7 +77,7 @@ namespace SourceGit.ViewModels
|
||||
needPopStash = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
succ = await new Commands.Checkout(_repo.FullPath)
|
||||
.Use(log)
|
||||
.BranchAsync(Branch, DiscardLocalChanges);
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace SourceGit.ViewModels
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var succ = false;
|
||||
var needPop = false;
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace SourceGit.ViewModels
|
||||
needPop = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
succ = await new Commands.Checkout(_repo.FullPath)
|
||||
.Use(log)
|
||||
.CommitAsync(Commit.SHA, DiscardLocalChanges);
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace SourceGit.ViewModels
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool succ;
|
||||
if (CheckoutAfterCreated && !_repo.IsBare)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ namespace SourceGit.ViewModels
|
||||
needPopStash = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
succ = await new Commands.Checkout(_repo.FullPath)
|
||||
.Use(log)
|
||||
.BranchAsync(fixedName, _baseOnRevision, DiscardLocalChanges, _allowOverwrite);
|
||||
|
||||
@@ -2614,15 +2614,40 @@ namespace SourceGit.ViewModels
|
||||
ev.Handled = true;
|
||||
};
|
||||
|
||||
var copy = new MenuItem();
|
||||
copy.Header = App.Text("Submodule.CopyPath");
|
||||
copy.Icon = App.CreateMenuIcon("Icons.Copy");
|
||||
copy.Click += async (_, ev) =>
|
||||
var copySHA = new MenuItem();
|
||||
copySHA.Header = App.Text("CommitDetail.Info.SHA");
|
||||
copySHA.Icon = App.CreateMenuIcon("Icons.Fingerprint");
|
||||
copySHA.Click += async (_, ev) =>
|
||||
{
|
||||
await App.CopyTextAsync(submodule.SHA);
|
||||
ev.Handled = true;
|
||||
};
|
||||
|
||||
var copyRelativePath = new MenuItem();
|
||||
copyRelativePath.Header = App.Text("Submodule.CopyPath");
|
||||
copyRelativePath.Icon = App.CreateMenuIcon("Icons.Folder");
|
||||
copyRelativePath.Click += async (_, ev) =>
|
||||
{
|
||||
await App.CopyTextAsync(submodule.Path);
|
||||
ev.Handled = true;
|
||||
};
|
||||
|
||||
var copyURL = new MenuItem();
|
||||
copyURL.Header = App.Text("Submodule.URL");
|
||||
copyURL.Icon = App.CreateMenuIcon("Icons.Link");
|
||||
copyURL.Click += async (_, ev) =>
|
||||
{
|
||||
await App.CopyTextAsync(submodule.URL);
|
||||
ev.Handled = true;
|
||||
};
|
||||
|
||||
var copy = new MenuItem();
|
||||
copy.Header = App.Text("Copy");
|
||||
copy.Icon = App.CreateMenuIcon("Icons.Copy");
|
||||
copy.Items.Add(copySHA);
|
||||
copy.Items.Add(copyRelativePath);
|
||||
copy.Items.Add(copyURL);
|
||||
|
||||
var menu = new ContextMenu();
|
||||
menu.Items.Add(open);
|
||||
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||
|
||||
Reference in New Issue
Block a user