git

package
v0.22.5 Latest Latest
Warning

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

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

Documentation

Overview

* © 2023 Snyk Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePath

func ResolvePath(p string) (absolutePath string, err error)

Types

type Commit

type Commit struct {
	Message string
	Author  string
	Email   string
}

type PatchMetadata

type PatchMetadata struct {
	Branch        string
	CommitMessage string
	CommitAuthor  string
}

type PushTarget

type PushTarget struct {
	RemoteName   string
	RemoteBranch string
	RemoteURL    string
	AuthToken    string
}

type Repository

type Repository struct {
	*gogit.Repository
	*gogit.Worktree
}

func CheckoutRemoteBranch

func CheckoutRemoteBranch(branch string) (*Repository, error)

CheckoutRemoteBranch checks out the git directory that we're currently in, with the given branch that needs to exist on the remote. Does not creaTe a local branch!

func (*Repository) CommitFiles

func (r *Repository) CommitFiles(commit *Commit, fileGlobs ...string) (commitSHA string, err error)

CommitFiles creates a commit with the given settings, adding all fileGlobs to the changeset.

func (*Repository) Push

func (r *Repository) Push(commitOrBranch string, push *PushTarget) error

Push the given commit SHA or Branch name to the push target. If push.RemoteBranch is set, the given commitOrBranch will be pushed to that branch, else it will be pushed to the commitOrBrach (untested).

Jump to

Keyboard shortcuts

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