mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
optimize<CreateBranch>: 增加一个对于空仓库建立分支的错误提示
This commit is contained in:
parent
f4237efaa2
commit
8191758a97
3 changed files with 7 additions and 1 deletions
|
@ -96,6 +96,7 @@
|
||||||
<sys:String x:Key="Text.CreateBranch.LocalChanges.StashAndReply">Stash & Reapply</sys:String>
|
<sys:String x:Key="Text.CreateBranch.LocalChanges.StashAndReply">Stash & Reapply</sys:String>
|
||||||
<sys:String x:Key="Text.CreateBranch.LocalChanges.Discard">Discard</sys:String>
|
<sys:String x:Key="Text.CreateBranch.LocalChanges.Discard">Discard</sys:String>
|
||||||
<sys:String x:Key="Text.CreateBranch.Checkout">Check out after created</sys:String>
|
<sys:String x:Key="Text.CreateBranch.Checkout">Check out after created</sys:String>
|
||||||
|
<sys:String x:Key="Text.CreateBranch.Idle">Git do not hold any branch until you do first commit.</sys:String>
|
||||||
|
|
||||||
<sys:String x:Key="Text.CreateTag">Create Tag</sys:String>
|
<sys:String x:Key="Text.CreateTag">Create Tag</sys:String>
|
||||||
<sys:String x:Key="Text.CreateTag.BasedOn">New Tag At :</sys:String>
|
<sys:String x:Key="Text.CreateTag.BasedOn">New Tag At :</sys:String>
|
||||||
|
|
|
@ -96,6 +96,7 @@
|
||||||
<sys:String x:Key="Text.CreateBranch.LocalChanges.StashAndReply">贮藏并自动恢复</sys:String>
|
<sys:String x:Key="Text.CreateBranch.LocalChanges.StashAndReply">贮藏并自动恢复</sys:String>
|
||||||
<sys:String x:Key="Text.CreateBranch.LocalChanges.Discard">忽略</sys:String>
|
<sys:String x:Key="Text.CreateBranch.LocalChanges.Discard">忽略</sys:String>
|
||||||
<sys:String x:Key="Text.CreateBranch.Checkout">完成后切换到新分支</sys:String>
|
<sys:String x:Key="Text.CreateBranch.Checkout">完成后切换到新分支</sys:String>
|
||||||
|
<sys:String x:Key="Text.CreateBranch.Idle">对于空仓库,只有提交一次有效数据,Git 才会创建第一个分支</sys:String>
|
||||||
|
|
||||||
<sys:String x:Key="Text.CreateTag">新建标签</sys:String>
|
<sys:String x:Key="Text.CreateTag">新建标签</sys:String>
|
||||||
<sys:String x:Key="Text.CreateTag.BasedOn">标签位于 :</sys:String>
|
<sys:String x:Key="Text.CreateTag.BasedOn">标签位于 :</sys:String>
|
||||||
|
|
|
@ -401,7 +401,11 @@ namespace SourceGit.Views.Widgets {
|
||||||
|
|
||||||
private void OpenNewBranch(object sender, RoutedEventArgs e) {
|
private void OpenNewBranch(object sender, RoutedEventArgs e) {
|
||||||
var current = repo.Branches.Find(x => x.IsCurrent);
|
var current = repo.Branches.Find(x => x.IsCurrent);
|
||||||
if (current != null) new Popups.CreateBranch(repo, current).Show();
|
if (current != null) {
|
||||||
|
new Popups.CreateBranch(repo, current).Show();
|
||||||
|
} else {
|
||||||
|
Models.Exception.Raise(App.Text("CreateBranch.Idle"));
|
||||||
|
}
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue