gittuf/pkg/gitinterface/remote.go
Pat Zielinski f649b141d3
pkg: Move gitinterface to pkg
Signed-off-by: Pat Zielinski <git@patzielinski.com>
2026-01-16 14:03:36 -05:00

21 lines
719 B
Go

// Copyright The gittuf Authors
// SPDX-License-Identifier: Apache-2.0
package gitinterface
// AddRemote adds a remote with the specified name and URL.
func (r *Repository) AddRemote(remoteName, url string) error {
_, err := r.executor("remote", "add", remoteName, url).executeString()
return err
}
// RemoveRemote removes the remote with the specified name.
func (r *Repository) RemoveRemote(remoteName string) error {
_, err := r.executor("remote", "remove", remoteName).executeString()
return err
}
// GetRemoteURL gets the URL of the remote with the specified name.
func (r *Repository) GetRemoteURL(remoteName string) (string, error) {
return r.executor("remote", "get-url", remoteName).executeString()
}