gitutil

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGitRemoteNotFound = errors.New("no git remotes found")

Functions

func CloneRepo

func CloneRepo(repoURL string) (string, error)

func SplitGithubURL added in v0.24.0

func SplitGithubURL(githubURL string) (account, repo string, ok bool)

Types

type Remote added in v0.22.0

type Remote struct {
	Name string
	URL  string
}

func ExtractGitRemote added in v0.24.0

func ExtractGitRemote(projectPath, remoteName string) (*Remote, string, error)

func ExtractRemotes added in v0.22.0

func ExtractRemotes(projectPath string) ([]Remote, error)

func RemotesToGithubURL added in v0.24.0

func RemotesToGithubURL(remotes []Remote) (*Remote, string, error)

type SyncStatus added in v0.24.0

type SyncStatus int
const (
	SyncStatusUnspecified SyncStatus = iota
	SyncStatusModified               // Local branch has untracked/modified changes
	SyncStatusAhead                  // Local branch is ahead of remote branch
	SyncStatusSynced                 // Local branch is in sync with remote branch
)

func GetSyncStatus added in v0.24.0

func GetSyncStatus(repoPath, branch, remote string) (SyncStatus, error)

GetSyncStatus returns the status of current branch as compared to remote/branch TODO: Need to implement cases like local branch is behind/diverged from remote branch

Jump to

Keyboard shortcuts

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