revParse

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitPath

func GitPath(rel ...string) (string, error)

GitPath resolves the given path to the .git directory (GIT_DIR). from https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_repository_locations GIT_DIR is the location of the .git folder. If this isn’t specified, Git walks up the directory tree until it gets to ~ or /, looking for a .git directory at every step.

func GitPathRelativeToTopLevelDirectory

func GitPathRelativeToTopLevelDirectory(rel ...string) string

func InsideWorkTree

func InsideWorkTree() bool

InsideWorkTree checks if the current working directory is inside the working tree of a git repository. returns true if the cwd in a git repository.

func TopLevelDirectory

func TopLevelDirectory() (string, error)

TopLevelDirectory computes the path to the top-level directory of the git repository.

Types

This section is empty.

Jump to

Keyboard shortcuts

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