gitrepo

package
v1.17.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitRepo

type GitRepo struct {
	// contains filtered or unexported fields
}

func NewGitRepo

func NewGitRepo(dirPath string) *GitRepo

NewGitRepo creates new GitRepo struct checks if the given directory path is part of git repository accordingly updates the fields of GitRepo struct and returns it

func (*GitRepo) GetFileCommitLabel

func (g *GitRepo) GetFileCommitLabel(filePath string) (string, error)

getFileCommitLabel returns the value of 'commit' label for the resources present in the file

The value of the `commit` label for different status of the file is as follows: | Git File Status | Label Value | |---------------------------------------|----------------------| | New untracked file | untracked | | New staged file | staged | | Tracked file with changes in worktree | <commitID>-unstaged | | Tracked file with changes staged | <commitID>-staged | | Tracked file with clean commit | <commitID> |

func (*GitRepo) IsGitRepo

func (g *GitRepo) IsGitRepo() bool

IsGitRepo returns if the initialized directory path is tracked by git repo

Jump to

Keyboard shortcuts

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