repository

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package repository provides functions to load information about a Git repository

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepositoryInfo

type RepositoryInfo struct {
	Path            string `json:"path"`          // local path where the repository is located
	Url             string `json:"url"`           // Remote URL
	CurrentBranch   string `json:"branch"`        // current branch
	CurrentRevision string `json:"revision"`      // current revision
	IsUpToDate      bool   `json:"is_up_to_date"` // True if there is no uncommitted changes in the local repository
}

A RepositoryInfo represents data about an initialized Git repository

func LoadRepositoryInfo

func LoadRepositoryInfo(path string) (*RepositoryInfo, error)

LoadRepositoryInfo loads Git repository information given a provided `path`.

It returns an error if the path doesn't exist or the path doesn't contain a valid Git repository.

Jump to

Keyboard shortcuts

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