Validate derived candidate tags before checks
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
// PrepareTaggedCheckout fetches one explicit tag ref, checks its peeled commit
|
||||
// against expectedCommit, and checks out that commit detached.
|
||||
func PrepareTaggedCheckout(ctx context.Context, repositoryDir, tag, remote, expectedCommit string) error {
|
||||
if err := checkTagRef(ctx, repositoryDir, tag); err != nil {
|
||||
if err := CheckTagRef(ctx, repositoryDir, tag); err != nil {
|
||||
return err
|
||||
}
|
||||
if !validObjectID(expectedCommit) {
|
||||
@@ -35,7 +35,7 @@ func PrepareTaggedCheckout(ctx context.Context, repositoryDir, tag, remote, expe
|
||||
// VerifyTaggedCheckout confirms that the existing local tag, HEAD, and clean
|
||||
// worktree all identify the expected commit. It does not fetch or check out.
|
||||
func VerifyTaggedCheckout(ctx context.Context, repositoryDir, tag, expectedCommit string) error {
|
||||
if err := checkTagRef(ctx, repositoryDir, tag); err != nil {
|
||||
if err := CheckTagRef(ctx, repositoryDir, tag); err != nil {
|
||||
return err
|
||||
}
|
||||
if !validObjectID(expectedCommit) {
|
||||
|
||||
Reference in New Issue
Block a user