From 5e8e011f6537e6822350a16a243db5802d4151e6 Mon Sep 17 00:00:00 2001 From: Daniel Martí Date: Wed, 14 Mar 2018 16:32:48 +0000 Subject: add PlainOpen variant to find .git in parent dirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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í --- options.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'options.go') 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 } -- cgit