tests(git-provider): Add duplicated repo registration test
This commit is contained in:
parent
cf2660b6b2
commit
30e103f021
2 changed files with 28 additions and 2 deletions
|
|
@ -138,8 +138,15 @@ public class GitManager
|
|||
// we add it to the relevant dictionary
|
||||
if (directorySegmentsFromName.Count == 0)
|
||||
{
|
||||
FullRepositoryPath = absoluteRepositoryLocation;
|
||||
return this;
|
||||
// If this is a new registration, set the FullRepositoryPath and return, otherwise we've got a duplicate
|
||||
// entry and we throw
|
||||
if (FullRepositoryPath == null)
|
||||
{
|
||||
FullRepositoryPath = absoluteRepositoryLocation;
|
||||
return this;
|
||||
}
|
||||
|
||||
throw new Exception($"Registration already exists for {InternalPath}");
|
||||
}
|
||||
|
||||
var nextSegment = directorySegmentsFromName.Peek();
|
||||
|
|
|
|||
Loading…
Reference in a new issue