diff options
author | Daniel Martí <mvdan@mvdan.cc> | 2018-03-14 16:32:48 +0000 |
---|---|---|
committer | Daniel Martí <mvdan@mvdan.cc> | 2018-04-03 16:14:07 +0100 |
commit | 5e8e011f6537e6822350a16a243db5802d4151e6 (patch) | |
tree | 2c27503469c0e5fb5ae6028819d20df673a2ab76 /options.go | |
parent | 247cf690745dfd67ccd9f0c07878e6dd85e6c9ed (diff) | |
download | go-git-5e8e011f6537e6822350a16a243db5802d4151e6.tar.gz |
add PlainOpen variant to find .git in parent dirs
This is the git tool's behavior that people are used to; if one runs a
git command in a repository's subdirectory, git still works.
Fixes #765.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Diffstat (limited to 'options.go')
-rw-r--r-- | options.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -420,3 +420,14 @@ func (o *GrepOptions) Validate(w *Worktree) error { return nil } + +// PlainOpenOptions describes how opening a plain repository should be +// performed. +type PlainOpenOptions struct { + // DetectDotGit defines whether parent directories should be + // walked until a .git directory or file is found. + DetectDotGit bool +} + +// Validate validates the fields and sets the default values. +func (o *PlainOpenOptions) Validate() error { return nil } |