vcs

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentBranch

func GetCurrentBranch(dir string) string

GetCurrentBranch returns the current git branch name for the given directory. If it fails to get the branch name, it returns an empty string.

func GetRemoteURL

func GetRemoteURL(dir string) string

GetRemoteURL returns the git remote URL for the given directory. It defaults to the "origin" remote. If it fails to get the URL, it returns an empty string.

func GetRepoRoot

func GetRepoRoot(path string) string

GetRepoRoot returns the absolute path to the git repository root for the given path. The input can be either a file or a directory within the repository. If the path is not inside a git repository or an error occurs, it returns an empty string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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