git

package
v1.19.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor added in v1.13.9

type Editor struct {
	Program string
	File    string
	Launch  func() error
	// contains filtered or unexported fields
}

Editor can be used to allow the user to directly edit content using their default IDE (set via `git var GIT_EDITOR`).

func NewEditor added in v1.13.9

func NewEditor(file string) (editor *Editor, err error)

NewEditor creates a new Editor instance, which can be used to launch the file with the user's default IDE. Accepts the name for the file.

func NewTemporaryFileEditor added in v1.13.9

func NewTemporaryFileEditor(filename string, content []byte) (editor *Editor, err error)

NewTemporaryFileEditor creates a new Editor instance, which can be used to launch a temporary file (containing the content that is passed into NewTemporaryFileEditor) with the user's default IDE. Accepts the name for the temporary file, and the file content. The name of the file will have a random string appended, or if an empty string is provided, the name will just be that random string. If the filename string includes a "*", the random string replaces the last "*".

func (*Editor) EditContent added in v1.13.9

func (e *Editor) EditContent() ([]byte, error)

EditContent launches git's default IDE and waits for the temporary file to be saved & closed before returning the edited file content.

type Interface

type Interface interface {
	Clone(string, string) error
	Pull(string) error
}

Interface defines the behaviors of the internal git package

type Operations

type Operations struct{}

Operations contains the behaviors of the internal git package

func (Operations) Clone

func (g Operations) Clone(appCachePath, app string) error

Clone clones a repo locally, returns an error if it fails

func (Operations) Pull

func (g Operations) Pull(appCachePath string) error

Pull will update the changes for the provided repo or fails

Jump to

Keyboard shortcuts

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