@@ -238,7 +238,8 @@ public void CreatingABranchTriggersTheCreationOfADirectReference()
238238 [ Fact ]
239239 public void CreatingABranchFromANonCommitObjectThrows ( )
240240 {
241- using ( var repo = new Repository ( BareTestRepoPath ) )
241+ string path = SandboxBareTestRepo ( ) ;
242+ using ( var repo = new Repository ( path ) )
242243 {
243244 const string name = "sorry-dude-i-do-not-do-blobs-nor-trees" ;
244245 Assert . Throws < InvalidSpecificationException > ( ( ) => repo . CreateBranch ( name , "refs/tags/point_to_blob" ) ) ;
@@ -250,7 +251,8 @@ public void CreatingABranchFromANonCommitObjectThrows()
250251 [ Fact ]
251252 public void CreatingBranchWithUnknownNamedTargetThrows ( )
252253 {
253- using ( var repo = new Repository ( BareTestRepoPath ) )
254+ string path = SandboxBareTestRepo ( ) ;
255+ using ( var repo = new Repository ( path ) )
254256 {
255257 Assert . Throws < LibGit2SharpException > ( ( ) => repo . Branches . Add ( "my_new_branch" , "my_old_branch" ) ) ;
256258 }
@@ -259,7 +261,8 @@ public void CreatingBranchWithUnknownNamedTargetThrows()
259261 [ Fact ]
260262 public void CreatingBranchWithUnknownShaTargetThrows ( )
261263 {
262- using ( var repo = new Repository ( BareTestRepoPath ) )
264+ string path = SandboxBareTestRepo ( ) ;
265+ using ( var repo = new Repository ( path ) )
263266 {
264267 Assert . Throws < LibGit2SharpException > ( ( ) => repo . Branches . Add ( "my_new_branch" , Constants . UnknownSha ) ) ;
265268 Assert . Throws < LibGit2SharpException > ( ( ) => repo . Branches . Add ( "my_new_branch" , Constants . UnknownSha . Substring ( 0 , 7 ) ) ) ;
@@ -269,7 +272,8 @@ public void CreatingBranchWithUnknownShaTargetThrows()
269272 [ Fact ]
270273 public void CreatingBranchWithBadParamsThrows ( )
271274 {
272- using ( var repo = new Repository ( BareTestRepoPath ) )
275+ string path = SandboxBareTestRepo ( ) ;
276+ using ( var repo = new Repository ( path ) )
273277 {
274278 Assert . Throws < ArgumentNullException > ( ( ) => repo . Branches . Add ( null , repo . Head . CanonicalName ) ) ;
275279 Assert . Throws < ArgumentException > ( ( ) => repo . Branches . Add ( string . Empty , repo . Head . CanonicalName ) ) ;
@@ -282,7 +286,8 @@ public void CreatingBranchWithBadParamsThrows()
282286 [ Fact ]
283287 public void CanListAllBranches ( )
284288 {
285- using ( var repo = new Repository ( BareTestRepoPath ) )
289+ string path = SandboxBareTestRepo ( ) ;
290+ using ( var repo = new Repository ( path ) )
286291 {
287292 Assert . Equal ( expectedBranches , SortedBranches ( repo . Branches , b => b . Name ) ) ;
288293
@@ -312,7 +317,8 @@ public void CanListBranchesWithRemoteAndLocalBranchWithSameShortName()
312317 [ Fact ]
313318 public void CanListAllBranchesWhenGivenWorkingDir ( )
314319 {
315- using ( var repo = new Repository ( StandardTestRepoWorkingDirPath ) )
320+ string path = SandboxStandardTestRepo ( ) ;
321+ using ( var repo = new Repository ( path ) )
316322 {
317323 var expectedWdBranches = new [ ]
318324 {
@@ -328,7 +334,8 @@ public void CanListAllBranchesWhenGivenWorkingDir()
328334 [ Fact ]
329335 public void CanListAllBranchesIncludingRemoteRefs ( )
330336 {
331- using ( var repo = new Repository ( StandardTestRepoPath ) )
337+ string path = SandboxStandardTestRepo ( ) ;
338+ using ( var repo = new Repository ( path ) )
332339 {
333340 var expectedBranchesIncludingRemoteRefs = new [ ]
334341 {
@@ -352,7 +359,8 @@ public void CanListAllBranchesIncludingRemoteRefs()
352359 [ Fact ]
353360 public void CanResolveRemote ( )
354361 {
355- using ( var repo = new Repository ( StandardTestRepoPath ) )
362+ string path = SandboxStandardTestRepo ( ) ;
363+ using ( var repo = new Repository ( path ) )
356364 {
357365 Branch master = repo . Branches [ "master" ] ;
358366 Assert . Equal ( repo . Network . Remotes [ "origin" ] , master . Remote ) ;
@@ -362,7 +370,8 @@ public void CanResolveRemote()
362370 [ Fact ]
363371 public void RemoteAndUpstreamBranchCanonicalNameForNonTrackingBranchIsNull ( )
364372 {
365- using ( var repo = new Repository ( StandardTestRepoPath ) )
373+ string path = SandboxStandardTestRepo ( ) ;
374+ using ( var repo = new Repository ( path ) )
366375 {
367376 Branch test = repo . Branches [ "i-do-numbers" ] ;
368377 Assert . Null ( test . Remote ) ;
@@ -374,7 +383,8 @@ public void RemoteAndUpstreamBranchCanonicalNameForNonTrackingBranchIsNull()
374383 public void QueryRemoteForLocalTrackingBranch ( )
375384 {
376385 // There is not a Remote to resolve for a local tracking branch.
377- using ( var repo = new Repository ( StandardTestRepoPath ) )
386+ string path = SandboxStandardTestRepo ( ) ;
387+ using ( var repo = new Repository ( path ) )
378388 {
379389 Branch trackLocal = repo . Branches [ "track-local" ] ;
380390 Assert . Null ( trackLocal . Remote ) ;
@@ -384,7 +394,8 @@ public void QueryRemoteForLocalTrackingBranch()
384394 [ Fact ]
385395 public void QueryUpstreamBranchCanonicalNameForLocalTrackingBranch ( )
386396 {
387- using ( var repo = new Repository ( StandardTestRepoPath ) )
397+ string path = SandboxStandardTestRepo ( ) ;
398+ using ( var repo = new Repository ( path ) )
388399 {
389400 Branch trackLocal = repo . Branches [ "track-local" ] ;
390401 Assert . Equal ( "refs/heads/master" , trackLocal . UpstreamBranchCanonicalName ) ;
@@ -394,7 +405,8 @@ public void QueryUpstreamBranchCanonicalNameForLocalTrackingBranch()
394405 [ Fact ]
395406 public void QueryRemoteForRemoteBranch ( )
396407 {
397- using ( var repo = new Repository ( StandardTestRepoPath ) )
408+ string path = SandboxStandardTestRepo ( ) ;
409+ using ( var repo = new Repository ( path ) )
398410 {
399411 var master = repo . Branches [ "origin/master" ] ;
400412 Assert . Equal ( repo . Network . Remotes [ "origin" ] , master . Remote ) ;
@@ -452,7 +464,8 @@ public void QueryAmbigousRemoteForRemoteBranch()
452464 [ Fact ]
453465 public void CanLookupABranchByItsCanonicalName ( )
454466 {
455- using ( var repo = new Repository ( BareTestRepoPath ) )
467+ string path = SandboxBareTestRepo ( ) ;
468+ using ( var repo = new Repository ( path ) )
456469 {
457470 Branch branch = repo . Branches [ "refs/heads/br2" ] ;
458471 Assert . NotNull ( branch ) ;
@@ -470,7 +483,8 @@ public void CanLookupABranchByItsCanonicalName()
470483 [ Fact ]
471484 public void CanLookupLocalBranch ( )
472485 {
473- using ( var repo = new Repository ( BareTestRepoPath ) )
486+ string path = SandboxBareTestRepo ( ) ;
487+ using ( var repo = new Repository ( path ) )
474488 {
475489 Branch master = repo . Branches [ "master" ] ;
476490 Assert . NotNull ( master ) ;
@@ -501,7 +515,8 @@ public void CanLookupABranchWhichNameIsMadeOfNon7BitsAsciiCharacters()
501515 [ Fact ]
502516 public void LookingOutABranchByNameWithBadParamsThrows ( )
503517 {
504- using ( var repo = new Repository ( BareTestRepoPath ) )
518+ string path = SandboxBareTestRepo ( ) ;
519+ using ( var repo = new Repository ( path ) )
505520 {
506521 Branch branch ;
507522 Assert . Throws < ArgumentNullException > ( ( ) => branch = repo . Branches [ null ] ) ;
@@ -587,7 +602,8 @@ public void TrackingInformationIsEmptyForBranchTrackingPrunedRemoteBranch()
587602 [ Fact ]
588603 public void TrackingInformationIsEmptyForNonTrackingBranch ( )
589604 {
590- using ( var repo = new Repository ( BareTestRepoPath ) )
605+ string path = SandboxBareTestRepo ( ) ;
606+ using ( var repo = new Repository ( path ) )
591607 {
592608 Branch branch = repo . Branches [ "test" ] ;
593609 Assert . False ( branch . IsTracking ) ;
@@ -603,7 +619,8 @@ public void TrackingInformationIsEmptyForNonTrackingBranch()
603619 [ Fact ]
604620 public void CanGetTrackingInformationForTrackingBranch ( )
605621 {
606- using ( var repo = new Repository ( StandardTestRepoPath ) )
622+ string path = SandboxStandardTestRepo ( ) ;
623+ using ( var repo = new Repository ( path ) )
607624 {
608625 Branch master = repo . Branches [ "master" ] ;
609626 Assert . True ( master . IsTracking ) ;
@@ -619,7 +636,8 @@ public void CanGetTrackingInformationForTrackingBranch()
619636 [ Fact ]
620637 public void CanGetTrackingInformationForLocalTrackingBranch ( )
621638 {
622- using ( var repo = new Repository ( StandardTestRepoPath ) )
639+ string path = SandboxStandardTestRepo ( ) ;
640+ using ( var repo = new Repository ( path ) )
623641 {
624642 var branch = repo . Branches [ "track-local" ] ;
625643 Assert . True ( branch . IsTracking ) ;
@@ -635,7 +653,8 @@ public void CanGetTrackingInformationForLocalTrackingBranch()
635653 [ Fact ]
636654 public void RenamingARemoteTrackingBranchThrows ( )
637655 {
638- using ( var repo = new Repository ( StandardTestRepoPath ) )
656+ string path = SandboxStandardTestRepo ( ) ;
657+ using ( var repo = new Repository ( path ) )
639658 {
640659 Branch master = repo . Branches [ "refs/remotes/origin/master" ] ;
641660 Assert . True ( master . IsRemote ) ;
@@ -647,7 +666,8 @@ public void RenamingARemoteTrackingBranchThrows()
647666 [ Fact ]
648667 public void CanWalkCommitsFromAnotherBranch ( )
649668 {
650- using ( var repo = new Repository ( BareTestRepoPath ) )
669+ string path = SandboxBareTestRepo ( ) ;
670+ using ( var repo = new Repository ( path ) )
651671 {
652672 Branch master = repo . Branches [ "test" ] ;
653673 Assert . Equal ( 2 , master . Commits . Count ( ) ) ;
@@ -813,7 +833,8 @@ public void CanUnsetTrackedBranch()
813833 [ Fact ]
814834 public void CanWalkCommitsFromBranch ( )
815835 {
816- using ( var repo = new Repository ( BareTestRepoPath ) )
836+ string path = SandboxBareTestRepo ( ) ;
837+ using ( var repo = new Repository ( path ) )
817838 {
818839 Branch master = repo . Branches [ "master" ] ;
819840 Assert . Equal ( 7 , master . Commits . Count ( ) ) ;
@@ -871,7 +892,8 @@ public void CanRemoveANonExistingBranch(string branchName, bool isRemote)
871892 [ Fact ]
872893 public void RemovingABranchWhichIsTheCurrentHeadThrows ( )
873894 {
874- using ( var repo = new Repository ( BareTestRepoPath ) )
895+ string path = SandboxBareTestRepo ( ) ;
896+ using ( var repo = new Repository ( path ) )
875897 {
876898 Assert . Throws < LibGit2SharpException > ( ( ) => repo . Branches . Remove ( repo . Head . Name ) ) ;
877899 }
@@ -880,7 +902,8 @@ public void RemovingABranchWhichIsTheCurrentHeadThrows()
880902 [ Fact ]
881903 public void RemovingABranchWithBadParamsThrows ( )
882904 {
883- using ( var repo = new Repository ( BareTestRepoPath ) )
905+ string path = SandboxBareTestRepo ( ) ;
906+ using ( var repo = new Repository ( path ) )
884907 {
885908 Assert . Throws < ArgumentException > ( ( ) => repo . Branches . Remove ( string . Empty ) ) ;
886909 Assert . Throws < ArgumentNullException > ( ( ) => repo . Branches . Remove ( null ) ) ;
@@ -890,7 +913,8 @@ public void RemovingABranchWithBadParamsThrows()
890913 [ Fact ]
891914 public void OnlyOneBranchIsTheHead ( )
892915 {
893- using ( var repo = new Repository ( BareTestRepoPath ) )
916+ string path = SandboxBareTestRepo ( ) ;
917+ using ( var repo = new Repository ( path ) )
894918 {
895919 Branch head = null ;
896920
@@ -957,7 +981,8 @@ public void CanRenameABranch()
957981 [ Fact ]
958982 public void BlindlyRenamingABranchOverAnExistingOneThrows ( )
959983 {
960- using ( var repo = new Repository ( BareTestRepoPath ) )
984+ string path = SandboxBareTestRepo ( ) ;
985+ using ( var repo = new Repository ( path ) )
961986 {
962987 Assert . Throws < NameConflictException > ( ( ) => repo . Branches . Rename ( "br2" , "test" ) ) ;
963988 }
@@ -1068,7 +1093,8 @@ public void TrackedBranchExistsFromDefaultConfigInEmptyClone()
10681093 [ Fact ]
10691094 public void RemoteBranchesDoNotTrackAnything ( )
10701095 {
1071- using ( var repo = new Repository ( StandardTestRepoPath ) )
1096+ string path = SandboxStandardTestRepo ( ) ;
1097+ using ( var repo = new Repository ( path ) )
10721098 {
10731099 var branches = repo . Branches . Where ( b => b . IsRemote ) ;
10741100
0 commit comments