// isClean returns true if the current working directory // is clean and false otherwise. func isClean() (bool, error) { files, err := status.GetFileStatus() if err != nil { return false, err } return status.IsClean(files, nil), nil }
// fillCommit fills a commit with all needed information func fillCommit(commit *meta.Commit, repo *meta.Repo) error { files, err := status.GetFileStatus() if err != nil { return err } if status.IsClean(files, nil) { return fmt.Errorf("\x1b[32;1mNothing to commit\x1b[0m") } err = commitPrompt(commit) if err != nil { return err } commit.Timestamp = time.Now() commitFiles(commit, repo, files) return nil }