Create Omni/Pipeline/Git.hs - typed git operations wrapper.
Thin wrapper around git process calls. Each function calls git via System.Process.readProcessWithExitCode and returns Either GitError a.
data GitError = GitError { geCommand :: Text, geExitCode :: Int, geStderr :: Text }
Functions:
- createWorktree :: FilePath -> Text -> Text -> IO (Either GitError FilePath)
-- (repoRoot, path, branch)
- removeWorktree :: FilePath -> FilePath -> IO (Either GitError ())
- checkoutBranch :: FilePath -> Text -> IO (Either GitError ())
- createBranch :: FilePath -> Text -> Text -> IO (Either GitError ())
-- (workspace, branchName, startPoint)
- deleteBranch :: FilePath -> Text -> IO (Either GitError ())
- cherryPick :: FilePath -> Text -> IO (Either GitError Text)
-- returns commit hash on success
- abortCherryPick :: FilePath -> IO (Either GitError ())
- commitCountBetween :: FilePath -> Text -> Text -> IO (Either GitError Int)
- currentBranchSha :: FilePath -> Text -> IO (Maybe Text)
- isCleanWorkspace :: FilePath -> IO Bool
- worktreeExists :: FilePath -> IO Bool
- revertLastCommit :: FilePath -> IO (Either GitError ())
Include a helper: runGit :: FilePath -> [String] -> IO (Either GitError String)
No tests needed for this module - it's a thin wrapper. Verified by typecheck.
Verify: typecheck.sh Omni/Pipeline/Git.hs