Documentation
¶
Index ¶
- func GetCurrentBranch(ctx context.Context, repoPath string) (string, error)
- func GetCurrentCommit(ctx context.Context, repoPath string) (string, error)
- func GetRemoteURL(ctx context.Context, repoPath string) (string, error)
- func GetRepoRoot(ctx context.Context, path string) (string, error)
- func HasUncommittedChanges(ctx context.Context, repoPath string) (bool, error)
- func IsGitRepo(path string) bool
- type GitContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentBranch ¶
GetCurrentBranch returns the current branch name
func GetCurrentCommit ¶
GetCurrentCommit returns the current commit SHA
func GetRemoteURL ¶
GetRemoteURL returns the remote URL for the repository (typically 'origin')
func GetRepoRoot ¶
GetRepoRoot returns the root directory of the Git repository
func HasUncommittedChanges ¶
HasUncommittedChanges checks if there are uncommitted changes in the repository
Types ¶
type GitContext ¶
type GitContext struct {
IsRepo bool // True if current directory is in a Git repository
RepoRoot string // Absolute path to repository root
RepoURL string // Remote repository URL
RelativePath string // Current path relative to repo root
}
GitContext represents the current Git repository context
func DetectContext ¶
func DetectContext(ctx context.Context) (*GitContext, error)
DetectContext detects the Git context for the current working directory
func DetectContextForPath ¶
func DetectContextForPath(ctx context.Context, path string) (*GitContext, error)
DetectContextForPath detects the Git context for a specific path
Click to show internal directories.
Click to hide internal directories.