Skip to content

Commit

Permalink
Formatting and local function
Browse files Browse the repository at this point in the history
  • Loading branch information
drewnoakes committed Aug 9, 2018
1 parent a812482 commit a939287
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions GitUI/CommandsDialogs/FormReflog.cs
Expand Up @@ -113,16 +113,13 @@ private ObjectId GetShaOfRefLine()
var row = GetSelectedRow();
var refLine = (RefLine)row.DataBoundItem;
return refLine.Sha;
}

private DataGridViewRow GetSelectedRow()
{
if (gridReflog.SelectedRows.Count > 0)
DataGridViewRow GetSelectedRow()
{
return gridReflog.SelectedRows[0];
return gridReflog.SelectedRows.Count > 0
? gridReflog.SelectedRows[0]
: gridReflog.Rows[gridReflog.SelectedCells[0].RowIndex];
}

return gridReflog.Rows[gridReflog.SelectedCells[0].RowIndex];
}

private void resetCurrentBranchOnThisCommitToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -161,7 +158,8 @@ private void linkHead_Click(object sender, EventArgs e)

private void gridReflog_MouseMove(object sender, MouseEventArgs e)
{
DataGridView.HitTestInfo hit = gridReflog.HitTest(e.X, e.Y);
var hit = gridReflog.HitTest(e.X, e.Y);

if (hit.Type == DataGridViewHitTestType.Cell && _lastHitRowIndex != hit.RowIndex)
{
gridReflog.Rows[_lastHitRowIndex].Selected = false;
Expand Down

0 comments on commit a939287

Please sign in to comment.