Skip to content

Ugly NullReferenceException if not in a git repo #853

@roji

Description

@roji

The following seems a bit much (GitVersion 1.0.0.1):

C:\>gitversion
INFO [05/06/16 13:41:29:08] Working directory: C:\
ERROR [05/06/16 13:41:29:11] An unexpected error occurred:
System.NullReferenceException: Object reference not set to an instance of an object.
   at GitVersion.GitPreparer.GetDotGitDirectory()
   at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId)
   at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
   at GitVersion.Program.VerifyArgumentsAndRun()
INFO [05/06/16 13:41:29:11]
INFO [05/06/16 13:41:29:11] Here is the current git graph (please include in issue):
INFO [05/06/16 13:41:29:11] Showing max of 100 commits
INFO [05/06/16 13:41:29:17] ERROR: fatal: Not a git repository (or any of the parent directories): .git

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions