Skip to content

Commit

Permalink
Display current branch name
Browse files Browse the repository at this point in the history
next to the branch creation button
  • Loading branch information
pmiossec committed Dec 13, 2017
1 parent b12fdf2 commit bacf470
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
13 changes: 11 additions & 2 deletions GitUI/CommandsDialogs/FormCommit.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions GitUI/CommandsDialogs/FormCommit.cs
Expand Up @@ -126,6 +126,7 @@ public sealed partial class FormCommit : GitModuleForm //, IHotkeyable
+ Environment.NewLine + "Use this feature when a file is big and never change."
+ Environment.NewLine + "Git will never check if the file has changed that will improve status check performance.");

private readonly TranslationString _currentBranchLabel = new TranslationString("(On branch: {0})");
#endregion

private readonly ICommitTemplateManager _commitTemplateManager;
Expand Down Expand Up @@ -659,10 +660,15 @@ private void EnableStageButtons(bool enable)
ResetUnStaged.Enabled = Unstaged.AllItems.Any();
}

private void SetDialogTitle()
private void UpdateBranchNameDisplay()
{
Task.Run(() => string.Format(_formTitle.Text, Module.GetSelectedBranch(), Module.WorkingDir))
.ContinueWith(task => Text = task.Result, _taskScheduler);
Task.Run(() => Module.GetSelectedBranch())
.ContinueWith(task =>
{
var currentBranchName = task.Result;
toolStripLabelbranchName.Text = string.Format(_currentBranchLabel.Text, currentBranchName);
Text = string.Format(_formTitle.Text, currentBranchName, Module.WorkingDir);
}, _taskScheduler);
}

private bool _initialized;
Expand All @@ -671,7 +677,7 @@ private void Initialize(bool loadUnstaged)
{
_initialized = true;

SetDialogTitle();
UpdateBranchNameDisplay();
Cursor.Current = Cursors.WaitCursor;

if (loadUnstaged)
Expand Down Expand Up @@ -2775,7 +2781,7 @@ private void createBranchToolStripButton_Click(object sender, EventArgs e)
{
return;
}
SetDialogTitle();
UpdateBranchNameDisplay();
}

private void Message_Enter(object sender, EventArgs e)
Expand Down

0 comments on commit bacf470

Please sign in to comment.