You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix running tests on macOS
On macOS, the temporary directory contains a symlink and all tests using `DisposableRepository` would fail with the following error:
> System.ArgumentException
Unable to process file '/var/folders/62/pz7b9x0x7hv54vy47pllqlvw0000gn/T/edic1ukd/.gitignore'. This file is not located under the working directory of the repository ('/private/var/folders/62/pz7b9x0x7hv54vy47pllqlvw0000gn/T/edic1ukd/').
at LibGit2Sharp.RepositoryExtensions.BuildRelativePathFrom(IRepository repo, String path) in /_/LibGit2Sharp/RepositoryExtensions.cs:line 215
at LibGit2Sharp.Repository.ToFilePaths(IEnumerable`1 paths) in /_/LibGit2Sharp/Repository.cs:line 1676
at LibGit2Sharp.Diff.BuildDiffList(ObjectId oldTreeId, ObjectId newTreeId, TreeComparisonHandleRetriever comparisonHandleRetriever, DiffModifiers diffOptions, IEnumerable`1 paths, ExplicitPathsOptions explicitPathsOptions, CompareOptions compareOptions) in /_/LibGit2Sharp/Diff.cs:line 544
at LibGit2Sharp.Diff.Compare[T](DiffModifiers diffOptions, IEnumerable`1 paths, ExplicitPathsOptions explicitPathsOptions, CompareOptions compareOptions) in /_/LibGit2Sharp/Diff.cs:line 483
at LibGit2Sharp.Commands.Stage(IRepository repository, IEnumerable`1 paths, StageOptions stageOptions) in /_/LibGit2Sharp/Commands/Stage.cs:line 77
at LibGit2Sharp.Commands.Stage(IRepository repository, String path) in /_/LibGit2Sharp/Commands/Stage.cs:line 25
at Incrementalist.Tests.Helpers.DisposableRepository.WriteFile(String fileName, String fileText) in ~/Incrementalist/src/Incrementalist.Tests/Helpers/DisposableRepository.cs:line 131
at Incrementalist.Tests.Helpers.DisposableRepository.Init() in ~/Incrementalist/src/Incrementalist.Tests/Helpers/DisposableRepository.cs:line 93
at Incrementalist.Tests.Helpers.DisposableRepository..ctor(AbsolutePath basePath) in ~/Incrementalist/src/Incrementalist.Tests/Helpers/DisposableRepository.cs:line 56
at Incrementalist.Tests.Helpers.DisposableRepository..ctor() in ~/Incrementalist/src/Incrementalist.Tests/Helpers/DisposableRepository.cs:line 46
at Incrementalist.Tests.Git.GitBranchDetectionSpecs..ctor() in ~/Incrementalist/src/Incrementalist.Tests/Git/GitBranchDetectionSpecs.cs:line 18
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
See also libgit2/libgit2sharp#1945
* Ensure that the default branch is named `master`
Many tests are assuming the default branch is `master`. But if the `~/.gitconfig` file contains another default branch name, then all these tests will fail.
```ini
[init]
defaultBranch = "main"
```
See [How to control the name of the default branch from Repository.Init?][1] on the LibGit2Sharp repository.
[1]: libgit2/libgit2sharp#1964
0 commit comments