@@ -33,7 +33,6 @@ public QueryCommits(string repo, int maxCount, string messageFilter, bool isFile
33
33
argsBuilder . Append ( "--all-match -i" ) ;
34
34
search = argsBuilder . ToString ( ) ;
35
35
}
36
-
37
36
38
37
WorkingDirectory = repo ;
39
38
Context = repo ;
@@ -63,7 +62,9 @@ public QueryCommits(string repo, int maxCount, string messageFilter, bool isFile
63
62
ParseParent ( line ) ;
64
63
break ;
65
64
case 2 :
66
- ParseDecorators ( line ) ;
65
+ _current . ParseDecorators ( line ) ;
66
+ if ( _current . IsMerged && ! _isHeadFounded )
67
+ _isHeadFounded = true ;
67
68
break ;
68
69
case 3 :
69
70
_current . Author = Models . User . FindOrAdd ( line ) ;
@@ -114,74 +115,6 @@ private void ParseParent(string data)
114
115
_current . Parents . Add ( data . Substring ( idx + 1 ) ) ;
115
116
}
116
117
117
- private void ParseDecorators ( string data )
118
- {
119
- if ( data . Length < 3 )
120
- return ;
121
-
122
- var subs = data . Split ( ',' , StringSplitOptions . RemoveEmptyEntries ) ;
123
- foreach ( var sub in subs )
124
- {
125
- var d = sub . Trim ( ) ;
126
- if ( d . EndsWith ( "/HEAD" , StringComparison . Ordinal ) )
127
- continue ;
128
-
129
- if ( d . StartsWith ( "tag: refs/tags/" , StringComparison . Ordinal ) )
130
- {
131
- _current . Decorators . Add ( new Models . Decorator ( )
132
- {
133
- Type = Models . DecoratorType . Tag ,
134
- Name = d . Substring ( 15 ) ,
135
- } ) ;
136
- }
137
- else if ( d . StartsWith ( "HEAD -> refs/heads/" , StringComparison . Ordinal ) )
138
- {
139
- _current . IsMerged = true ;
140
- _current . Decorators . Add ( new Models . Decorator ( )
141
- {
142
- Type = Models . DecoratorType . CurrentBranchHead ,
143
- Name = d . Substring ( 19 ) ,
144
- } ) ;
145
- }
146
- else if ( d . Equals ( "HEAD" ) )
147
- {
148
- _current . IsMerged = true ;
149
- _current . Decorators . Add ( new Models . Decorator ( )
150
- {
151
- Type = Models . DecoratorType . CurrentCommitHead ,
152
- Name = d ,
153
- } ) ;
154
- }
155
- else if ( d . StartsWith ( "refs/heads/" , StringComparison . Ordinal ) )
156
- {
157
- _current . Decorators . Add ( new Models . Decorator ( )
158
- {
159
- Type = Models . DecoratorType . LocalBranchHead ,
160
- Name = d . Substring ( 11 ) ,
161
- } ) ;
162
- }
163
- else if ( d . StartsWith ( "refs/remotes/" , StringComparison . Ordinal ) )
164
- {
165
- _current . Decorators . Add ( new Models . Decorator ( )
166
- {
167
- Type = Models . DecoratorType . RemoteBranchHead ,
168
- Name = d . Substring ( 13 ) ,
169
- } ) ;
170
- }
171
- }
172
-
173
- _current . Decorators . Sort ( ( l , r ) =>
174
- {
175
- if ( l . Type != r . Type )
176
- return ( int ) l . Type - ( int ) r . Type ;
177
- else
178
- return string . Compare ( l . Name , r . Name , StringComparison . Ordinal ) ;
179
- } ) ;
180
-
181
- if ( _current . IsMerged && ! _isHeadFounded )
182
- _isHeadFounded = true ;
183
- }
184
-
185
118
private void MarkFirstMerged ( )
186
119
{
187
120
Args = $ "log --since=\" { _commits [ ^ 1 ] . CommitterTimeStr } \" --format=\" %H\" ";
0 commit comments