@@ -188,48 +188,35 @@ private void RefreshOnMainThread()
188
188
189
189
private void MaybeUpdateData ( )
190
190
{
191
- string repoRemote = null ;
192
- var repoDataChanged = false ;
191
+ string updatedRepoBranch = null ;
192
+ string updatedRepoRemote = null ;
193
+ string updatedRepoUrl = DefaultRepoUrl ;
194
+
193
195
if ( Repository != null )
194
196
{
195
- var currentBranchString = ( Repository . CurrentBranch . HasValue ? Repository . CurrentBranch . Value . Name : null ) ;
196
- if ( repoBranch != currentBranchString )
197
- {
198
- repoBranch = currentBranchString ;
199
- repoDataChanged = true ;
200
- }
197
+ var repositoryCurrentBranch = Repository . CurrentBranch ;
198
+ updatedRepoBranch = repositoryCurrentBranch . HasValue ? repositoryCurrentBranch . Value . Name : null ;
201
199
202
- var url = Repository . CloneUrl != null ? Repository . CloneUrl . ToString ( ) : DefaultRepoUrl ;
203
- if ( repoUrl != url )
204
- {
205
- repoUrl = url ;
206
- repoDataChanged = true ;
207
- }
200
+ var repositoryCloneUrl = Repository . CloneUrl ;
201
+ updatedRepoUrl = repositoryCloneUrl != null ? repositoryCloneUrl . ToString ( ) : DefaultRepoUrl ;
208
202
209
- if ( Repository . CurrentRemote . HasValue )
210
- repoRemote = Repository . CurrentRemote . Value . Name ;
203
+ var repositoryCurrentRemote = Repository . CurrentRemote ;
204
+ if ( repositoryCurrentRemote . HasValue )
205
+ updatedRepoRemote = repositoryCurrentRemote . Value . Name ;
211
206
}
212
- else
213
- {
214
- if ( repoBranch != null )
215
- {
216
- repoBranch = null ;
217
- repoDataChanged = true ;
218
- }
219
207
220
- if ( repoUrl != DefaultRepoUrl )
221
- {
222
- repoUrl = DefaultRepoUrl ;
223
- repoDataChanged = true ;
224
- }
208
+ if ( repoBranch != updatedRepoBranch )
209
+ {
210
+ repoBranch = updatedRepoBranch ;
211
+ repoBranchContent = new GUIContent ( repoBranch , Window_RepoBranchTooltip ) ;
225
212
}
226
213
227
- if ( repoDataChanged )
214
+ if ( repoUrl != updatedRepoUrl )
228
215
{
229
- repoBranchContent = new GUIContent ( repoBranch , Window_RepoBranchTooltip ) ;
216
+ repoUrl = updatedRepoUrl ;
230
217
if ( repoUrl != null )
231
218
{
232
- repoUrlContent = new GUIContent ( repoUrl , string . Format ( Window_RepoUrlTooltip , repoRemote ) ) ;
219
+ repoUrlContent = new GUIContent ( repoUrl , string . Format ( Window_RepoUrlTooltip , updatedRepoRemote ) ) ;
233
220
}
234
221
else
235
222
{
0 commit comments