Add todo mode and replace the plan with TODO.md
This commit is contained in:
@@ -236,6 +236,18 @@ func Head(dir string) (string, error) {
|
||||
return run(dir, "rev-parse", "HEAD")
|
||||
}
|
||||
|
||||
func ReadFile(repo, rev, path string) (string, bool, error) {
|
||||
_, _, code, err := runCode(repo, nil, "cat-file", "-e", rev+":"+path)
|
||||
if err != nil {
|
||||
return "", false, err
|
||||
}
|
||||
if code != 0 {
|
||||
return "", false, nil
|
||||
}
|
||||
out, err := run(repo, "cat-file", "blob", rev+":"+path)
|
||||
return out, true, err
|
||||
}
|
||||
|
||||
func CommitAll(dir, message, name, email string) (string, error) {
|
||||
status, err := run(dir, "status", "--porcelain", "--untracked-files=all")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user