Categorygithub.com/Songmu/gitmock
repositorypackage
0.0.2
Repository: https://github.com/songmu/gitmock.git
Documentation: pkg.go.dev

# README

gitmock

Test Status codecov.io MIT License PkgGoDev

Description

Create mock git repository for testing.

Synopsis

gm, err := gitmock.New("")
if err != nil {
    log.Fatal(err)
}
defer os.RemoveAll(gm.RepoPath())
gm.Init() // shortcut of `gm.Do("init")
file := "hoge/fuga.txt"
gm.PutFile(file, "aaa\n")
gm.Add(file)
gm.Commit("-m", "initial commit")
out, stderr, err := gm.Status()

Author

Songmu