gitutil

package
v0.12.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package gitutil shells out to the `git` CLI (docs/conventions.md: "Git/GitHub: never go-git") to answer the small set of questions m1-sessions needs about a launch directory: is it a git checkout, what branch is it on, and is it a linked worktree. Nothing here is Claude-Code-format knowledge; it stays out of internal/claudecode by design.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Branch

func Branch(ctx context.Context, dir string) *string

Branch returns the current branch name, or nil when dir isn't a git checkout or is in a detached-HEAD state (session.branch is "null when not git" — Schema Changes).

func IsRepo

func IsRepo(ctx context.Context, dir string) bool

IsRepo reports whether dir is inside a git working tree.

func IsWorktree

func IsWorktree(ctx context.Context, dir string) bool

IsWorktree reports whether dir is a linked worktree: its git-dir and the repository's common-dir differ (ux-flows §2's recognition rule).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL