Skip to content

Commit 609418f

Browse files
committed
refactor: simplify InteractiveRebaseItem
Signed-off-by: leo <longshuang@msn.cn>
1 parent cfa7e0e commit 609418f

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

src/ViewModels/InteractiveRebase.cs

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,30 +60,13 @@ public string OriginalFullMessage
6060
public bool CanSquashOrFixup
6161
{
6262
get => _canSquashOrFixup;
63-
set
64-
{
65-
if (SetProperty(ref _canSquashOrFixup, value))
66-
{
67-
if (_action == Models.InteractiveRebaseAction.Squash || _action == Models.InteractiveRebaseAction.Fixup)
68-
{
69-
Action = Models.InteractiveRebaseAction.Pick;
70-
FullMessage = OriginalFullMessage;
71-
}
72-
}
73-
}
63+
set => SetProperty(ref _canSquashOrFixup, value);
7464
}
7565

7666
public bool CanReword
7767
{
7868
get => _canReword;
79-
set
80-
{
81-
if (SetProperty(ref _canReword, value) && _action == Models.InteractiveRebaseAction.Reword)
82-
{
83-
Action = Models.InteractiveRebaseAction.Pick;
84-
FullMessage = OriginalFullMessage;
85-
}
86-
}
69+
set => SetProperty(ref _canReword, value);
8770
}
8871

8972
public bool ShowEditMessageButton
@@ -335,6 +318,9 @@ private void UpdateItems()
335318
else
336319
{
337320
item.CanSquashOrFixup = false;
321+
if (item.Action == Models.InteractiveRebaseAction.Squash || item.Action == Models.InteractiveRebaseAction.Fixup)
322+
item.Action = Models.InteractiveRebaseAction.Pick;
323+
338324
hasValidParent = item.Action != Models.InteractiveRebaseAction.Drop;
339325
}
340326
}

0 commit comments

Comments
 (0)