Derive module release identity and accept full Git tags
This commit is contained in:
@@ -32,6 +32,37 @@ func TestInspectTaggedSourceSupportsLightweightAndAnnotatedTags(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTagOperationsAcceptFullSlashContainingRefs(t *testing.T) {
|
||||
fixture := newRemoteFixture(t)
|
||||
tag := "integrations/check/v2.3.4"
|
||||
if err := checkTagRef(context.Background(), fixture.work, tag); err != nil {
|
||||
t.Fatalf("checkTagRef(%q): %v", tag, err)
|
||||
}
|
||||
object, err := CreateAnnotatedTag(context.Background(), fixture.work, tag, fixture.commit, []byte("release note\n"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := InspectLocalTag(context.Background(), fixture.work, tag, object); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
source, err := InspectTaggedSource(context.Background(), fixture.work, tag)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if source.TagCommit != fixture.commit || source.TagObject != object || source.TagObjectType != "tag" {
|
||||
t.Fatalf("source for %q = %#v", tag, source)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTagReferenceValidationUsesGitRules(t *testing.T) {
|
||||
fixture := newRemoteFixture(t)
|
||||
for _, tag := range []string{"", "v1..2.3", "v1.2.3.lock", "v1.2.3/", "v1.2.3\\bad"} {
|
||||
if err := checkTagRef(context.Background(), fixture.work, tag); err == nil {
|
||||
t.Errorf("checkTagRef(%q) succeeded", tag)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCandidateObjectReadsStayLocalInPartialClones(t *testing.T) {
|
||||
fixture := newRemoteFixture(t)
|
||||
gitRun(t, fixture.work, "config", "uploadpack.allowFilter", "true")
|
||||
|
||||
Reference in New Issue
Block a user