File tree Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ namespace SourceGit.Commands
6
6
{
7
7
public partial class CompareRevisions : Command
8
8
{
9
- [ GeneratedRegex ( @"^([MADRC ])\s+(.+)$" ) ]
9
+ [ GeneratedRegex ( @"^([MADC ])\s+(.+)$" ) ]
10
10
private static partial Regex REG_FORMAT ( ) ;
11
+ [ GeneratedRegex ( @"^R[0-9]{0,4}\s+(.+)$" ) ]
12
+ private static partial Regex REG_RENAME_FORMAT ( ) ;
11
13
12
14
public CompareRevisions ( string repo , string start , string end )
13
15
{
@@ -38,7 +40,17 @@ protected override void OnReadline(string line)
38
40
{
39
41
var match = REG_FORMAT ( ) . Match ( line ) ;
40
42
if ( ! match . Success )
43
+ {
44
+ match = REG_RENAME_FORMAT ( ) . Match ( line ) ;
45
+ if ( match . Success )
46
+ {
47
+ var renamed = new Models . Change ( ) { Path = match . Groups [ 1 ] . Value } ;
48
+ renamed . Set ( Models . ChangeState . Renamed ) ;
49
+ _changes . Add ( renamed ) ;
50
+ }
51
+
41
52
return ;
53
+ }
42
54
43
55
var change = new Models . Change ( ) { Path = match . Groups [ 2 ] . Value } ;
44
56
var status = match . Groups [ 1 ] . Value ;
@@ -57,10 +69,6 @@ protected override void OnReadline(string line)
57
69
change . Set ( Models . ChangeState . Deleted ) ;
58
70
_changes . Add ( change ) ;
59
71
break ;
60
- case 'R' :
61
- change . Set ( Models . ChangeState . Renamed ) ;
62
- _changes . Add ( change ) ;
63
- break ;
64
72
case 'C' :
65
73
change . Set ( Models . ChangeState . Copied ) ;
66
74
_changes . Add ( change ) ;
Original file line number Diff line number Diff line change @@ -9,8 +9,10 @@ namespace SourceGit.Commands
9
9
/// </summary>
10
10
public partial class QueryStashChanges : Command
11
11
{
12
- [ GeneratedRegex ( @"^([MADRC ])\s+(.+)$" ) ]
12
+ [ GeneratedRegex ( @"^([MADC ])\s+(.+)$" ) ]
13
13
private static partial Regex REG_FORMAT ( ) ;
14
+ [ GeneratedRegex ( @"^R[0-9]{0,4}\s+(.+)$" ) ]
15
+ private static partial Regex REG_RENAME_FORMAT ( ) ;
14
16
15
17
public QueryStashChanges ( string repo , string stash )
16
18
{
@@ -31,7 +33,17 @@ public QueryStashChanges(string repo, string stash)
31
33
{
32
34
var match = REG_FORMAT ( ) . Match ( line ) ;
33
35
if ( ! match . Success )
36
+ {
37
+ match = REG_RENAME_FORMAT ( ) . Match ( line ) ;
38
+ if ( match . Success )
39
+ {
40
+ var renamed = new Models . Change ( ) { Path = match . Groups [ 1 ] . Value } ;
41
+ renamed . Set ( Models . ChangeState . Renamed ) ;
42
+ outs . Add ( renamed ) ;
43
+ }
44
+
34
45
continue ;
46
+ }
35
47
36
48
var change = new Models . Change ( ) { Path = match . Groups [ 2 ] . Value } ;
37
49
var status = match . Groups [ 1 ] . Value ;
@@ -50,10 +62,6 @@ public QueryStashChanges(string repo, string stash)
50
62
change . Set ( Models . ChangeState . Deleted ) ;
51
63
outs . Add ( change ) ;
52
64
break ;
53
- case 'R' :
54
- change . Set ( Models . ChangeState . Renamed ) ;
55
- outs . Add ( change ) ;
56
- break ;
57
65
case 'C' :
58
66
change . Set ( Models . ChangeState . Copied ) ;
59
67
outs . Add ( change ) ;
You can’t perform that action at this time.
0 commit comments