IsModified check if repo is modified.
(repoDir string)
| 44 | |
| 45 | // IsModified check if repo is modified. |
| 46 | func IsModified(repoDir string) (bool, error) { |
| 47 | lines, err := statusLines(repoDir) |
| 48 | if err != nil { |
| 49 | return false, err |
| 50 | } |
| 51 | return len(lines) > 0, nil |
| 52 | } |
| 53 | |
| 54 | // CleanRepo clean local changes of a repo to HEAD. |
| 55 | func CleanRepo(repoDir string) error { |