Skip to content

Commit f916e83

Browse files
committed
Merge pull request #1748 from Hosch250/Issue157
Discover SC projects by project ID rather than name
2 parents 433ebcd + 09e65aa commit f916e83

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public enum SourceControlTab
2525
UnsyncedCommits,
2626
Settings
2727
}
28-
28+
2929
public sealed class SourceControlViewViewModel : ViewModelBase, IDisposable
3030
{
3131
private readonly VBE _vbe;
@@ -368,11 +368,11 @@ private void AddOrUpdateLocalPathConfig(Repository repo)
368368
var existing = _config.Repositories.Single(repository => repository.LocalLocation == repo.LocalLocation);
369369
if (string.IsNullOrEmpty(repo.RemoteLocation) && !string.IsNullOrEmpty(existing.RemoteLocation))
370370
{
371-
// config already has remote location and correct repository name - nothing to update
371+
// config already has remote location and correct repository id - nothing to update
372372
return;
373373
}
374374

375-
existing.Name = repo.Name;
375+
existing.Id = repo.Id;
376376
existing.RemoteLocation = repo.RemoteLocation;
377377

378378
_configService.Save(_config);
@@ -421,7 +421,7 @@ private void CloneRepo()
421421
Provider = _providerFactory.CreateProvider(_vbe.ActiveVBProject, repo, _wrapperFactory);
422422
AddOrUpdateLocalPathConfig(new Repository
423423
{
424-
Name = _vbe.ActiveVBProject.Name,
424+
Id = _vbe.ActiveVBProject.HelpFile,
425425
LocalLocation = repo.LocalLocation,
426426
RemoteLocation = repo.RemoteLocation
427427
});
@@ -462,7 +462,7 @@ private void OpenRepoAssignedToProject()
462462
{
463463
OnOpenRepoStarted();
464464
Provider = _providerFactory.CreateProvider(_vbe.ActiveVBProject,
465-
_config.Repositories.First(repo => repo.Name == _vbe.ActiveVBProject.Name), _wrapperFactory);
465+
_config.Repositories.First(repo => repo.Id == _vbe.ActiveVBProject.HelpFile), _wrapperFactory);
466466
Status = RubberduckUI.Online;
467467
}
468468
catch (SourceControlException ex)
@@ -496,7 +496,7 @@ private bool ValidRepoExists()
496496
return false;
497497
}
498498

499-
var possibleRepos = _config.Repositories.Where(repo => repo.Name == _vbe.ActiveVBProject.Name);
499+
var possibleRepos = _config.Repositories.Where(repo => repo.Id == _vbe.ActiveVBProject.HelpFile);
500500

501501
var possibleCount = possibleRepos.Count();
502502

@@ -544,7 +544,7 @@ public ICommand CloneRepoCommand
544544
{
545545
get { return _cloneRepoCommand; }
546546
}
547-
547+
548548
private readonly ICommand _showFilePickerCommand;
549549
public ICommand ShowFilePickerCommand
550550
{

Rubberduck.SourceControl/IRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Rubberduck.SourceControl
88
public interface IRepository
99
{
1010
[DispId(0)]
11-
string Name { get; }
11+
string Id { get; }
1212

1313
[DispId(1)]
1414
[Description("FilePath of local repository.")]

Rubberduck.SourceControl/Repository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ namespace Rubberduck.SourceControl
88
[ClassInterface(ClassInterfaceType.None)]
99
public class Repository : IRepository
1010
{
11-
public string Name { get; set; }
11+
public string Id { get; set; }
1212
public string LocalLocation { get; set; }
1313
public string RemoteLocation { get; set; }
1414

1515
//parameterless constructor for serialization
1616
public Repository() { }
1717

18-
public Repository(string name, string localDirectory, string remotePathOrUrl)
18+
public Repository(string id, string localDirectory, string remotePathOrUrl)
1919
{
20-
Name = name;
20+
Id = id;
2121
LocalLocation = localDirectory;
2222
RemoteLocation = remotePathOrUrl;
2323
}

0 commit comments

Comments
 (0)