Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/songmu/gitmock
https://github.com/songmu/gitmock
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/songmu/gitmock
- Owner: Songmu
- License: mit
- Created: 2016-04-30T06:11:58.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2022-08-14T17:24:05.000Z (about 2 years ago)
- Last Synced: 2024-10-11T21:09:23.902Z (27 days ago)
- Language: Go
- Size: 17.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
gitmock
=======[![Test Status](https://github.com/Songmu/gitmock/workflows/test/badge.svg?branch=main)][actions]
[![codecov.io](https://codecov.io/github/Songmu/gitmock/coverage.svg?branch=main)][codecov]
[![MIT License](https://img.shields.io/github/license/Songmu/gitmock)][license]
[![PkgGoDev](https://pkg.go.dev/badge/github.com/Songmu/gitmock)][PkgGoDev][actions]: https://github.com/Songmu/gitmock/actions?workflow=test
[codecov]: https://codecov.io/github/Songmu/gitmock?branch=main
[license]: https://github.com/Songmu/gitmock/blob/main/LICENSE
[PkgGoDev]: https://pkg.go.dev/github.com/Songmu/gitmock## Description
Create mock git repository for testing.
## Synopsis
```go
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](https://github.com/Songmu)