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 ¶
Types ¶
type PatchMetadata ¶
type PushTarget ¶
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).