aboutsummaryrefslogtreecommitdiffstats
path: root/options.go
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2018-03-14 16:32:48 +0000
committerDaniel Martí <mvdan@mvdan.cc>2018-04-03 16:14:07 +0100
commit5e8e011f6537e6822350a16a243db5802d4151e6 (patch)
tree2c27503469c0e5fb5ae6028819d20df673a2ab76 /options.go
parent247cf690745dfd67ccd9f0c07878e6dd85e6c9ed (diff)
downloadgo-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.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/options.go b/options.go
index f0c2fd8..885980e 100644
--- a/options.go
+++ b/options.go
@@ -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 }