gitutil

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGitignoreToWorktree

func AddGitignoreToWorktree(wt *git.Worktree, repositoryPath string) error

AddGitignoreToWorktree adds the exclude paths in the .gitignore file to the worktree. This is a workaround for https://github.com/go-git/go-git/issues/597. If we don't call this before doing add all then the ignore patterns won't be respected.

N.B this doesn't work with nested .gitignore files.

func LocateRoot

func LocateRoot(path string) (string, error)

LocateRoot locates the root of the git repository at path. Returns empty string if not a git repo.

Types

type User

type User struct {
	Name  string
	Email string
}

func LoadUser

func LoadUser(r *git.Repository) (*User, error)

LoadUser gets the user information for the repository.

Jump to

Keyboard shortcuts

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