gitutil

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangedFiles

func ChangedFiles(repo, sinceRev string) ([]string, error)

ChangedFiles returns the list of files differing in sinceRef and the working directory. Example of sinceRev: "origin/main".

func EnsureSameRepo

func EnsureSameRepo(files ...string) (repoDir string, err error)

EnsureSameRepo ensures that all files belong to the same git repository and returns its absolute path.

func Exec

func Exec(context string) func(args ...string) (out string, err error)

Exec returns a function that executes a git command and returns its standard output. The context must be a path to an existing file or directory.

It is suitable only for commands that exit quickly and have small output, e.g. rev-parse.

func RefExists

func RefExists(repoDir, ref string) (bool, error)

RefExists returns true if the git ref exists.

func TopLevel

func TopLevel(path string) (string, error)

TopLevel returns the repository dir for the path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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