GitRepo.this

Open a git repository.

Parameters:

path must either be a path to the .git directory or the base path of the .git directory.

If path does not exist or if the .git directory is not found in path, a GitException is thrown.

struct GitRepo
deprecated("Please use openRepository instead.")
this
(
in char[] path
)

Examples

1 // throw when path does not exist
2 assertThrown!GitException(openRepository(r".\invalid\path\.git"));
3 
4 // open using the path of the .git directory
5 auto repo1 = openRepository(_testRepo);
6 
7 // open using the base path of the .git directory
8 auto repo2 = openRepository(_testRepo.dirName);

Meta