Menu

[38707f]: / FormMergeBranch.cs  Maximize  Restore  History

Download this file

55 lines (44 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Windows.Forms;
namespace GitForce
{
/// <summary>
/// Form to merge a branch.
/// </summary>
public partial class FormMergeBranch : Form
{
public FormMergeBranch()
{
InitializeComponent();
ClassWinGeometry.Restore(this);
ClassBranches branches = App.Repos.Current.Branches;
labelCurrentBranchName.Text = "Current branch is \"" + branches.Current + "\"";
// Add all available branches to the list of branches to merge
foreach (var branch in branches.Local)
listBranches.Items.Add(branch);
foreach (var branch in branches.Remote)
listBranches.Items.Add(branch);
listBranches.Items.RemoveAt(listBranches.Items.IndexOf(branches.Current));
if (listBranches.Items.Count > 0)
{
listBranches.SelectedIndex = 0;
btMerge.Enabled = true;
}
}
/// <summary>
/// Form is closing.
/// </summary>
private void FormMergeBranchFormClosing(object sender, FormClosingEventArgs e)
{
ClassWinGeometry.Save(this);
}
/// <summary>
/// Button is clicked to perform a branch merge.
/// </summary>
private void BtMergeClick(object sender, EventArgs e)
{
string cmd = "merge " + listBranches.SelectedItem;
App.Repos.Current.RunCmd(cmd);
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.