aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorAshok Pon Kumar <ashokponkumar@gmail.com>2020-09-02 00:01:12 +0530
committerAshok Pon Kumar <ashokponkumar@gmail.com>2020-09-02 00:01:12 +0530
commite7be6a4e2442826f9a54f2d40e9658552972c644 (patch)
treea26312ac281bec5760d33064cc940609c1961e09 /repository_test.go
parent6da5e5958ecc0e6f8da6ee2b6714e50b8ef26df4 (diff)
downloadgo-git-e7be6a4e2442826f9a54f2d40e9658552972c644.tar.gz
support file path in PlainOpenWithOptions
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/repository_test.go b/repository_test.go
index 6a6ab9e..9433a3c 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -569,6 +569,11 @@ func (s *RepositorySuite) TestPlainOpenDetectDotGit(c *C) {
err = os.MkdirAll(subdir, 0755)
c.Assert(err, IsNil)
+ file := filepath.Join(subdir, "file.txt")
+ f, err := os.Create(file)
+ c.Assert(err, IsNil)
+ f.Close()
+
r, err := PlainInit(dir, false)
c.Assert(err, IsNil)
c.Assert(r, NotNil)
@@ -577,6 +582,11 @@ func (s *RepositorySuite) TestPlainOpenDetectDotGit(c *C) {
r, err = PlainOpenWithOptions(subdir, opt)
c.Assert(err, IsNil)
c.Assert(r, NotNil)
+
+ opt = &PlainOpenOptions{DetectDotGit: true}
+ r, err = PlainOpenWithOptions(file, opt)
+ c.Assert(err, IsNil)
+ c.Assert(r, NotNil)
}
func (s *RepositorySuite) TestPlainOpenNotExistsDetectDotGit(c *C) {