From 6132cbe667f1f2700dd9b037568ce9585703df09 Mon Sep 17 00:00:00 2001 From: mitchell Date: Fri, 20 Oct 2023 17:09:52 -0400 Subject: [PATCH] Lack of having a commit ID for push/pull is also an error. --- internal/runners/pull/pull.go | 4 ++-- internal/runners/push/push.go | 2 +- test/integration/pull_int_test.go | 2 +- test/integration/push_int_test.go | 18 ------------------ 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/internal/runners/pull/pull.go b/internal/runners/pull/pull.go index 2234aee863..586f3569d9 100644 --- a/internal/runners/pull/pull.go +++ b/internal/runners/pull/pull.go @@ -99,7 +99,7 @@ func (p *Pull) Run(params *PullParams) error { var localCommit *strfmt.UUID localCommitID, err := localcommit.Get(p.project.Dir()) - if err != nil && !localcommit.IsFileDoesNotExistError(err) { + if err != nil { return errs.Wrap(err, "Unable to get local commit") } if localCommitID != "" { @@ -151,7 +151,7 @@ func (p *Pull) Run(params *PullParams) error { } commitID, err := localcommit.Get(p.project.Dir()) - if err != nil && !localcommit.IsFileDoesNotExistError(err) { + if err != nil { return errs.Wrap(err, "Unable to get local commit") } diff --git a/internal/runners/push/push.go b/internal/runners/push/push.go index 25a54f1d83..2c32aa7bf2 100644 --- a/internal/runners/push/push.go +++ b/internal/runners/push/push.go @@ -254,7 +254,7 @@ func (r *Push) verifyInput() error { } commitID, err := localcommit.Get(r.project.Dir()) - if err != nil && !localcommit.IsFileDoesNotExistError(err) { + if err != nil { return errs.Wrap(err, "Unable to get local commit") } if commitID == "" { diff --git a/test/integration/pull_int_test.go b/test/integration/pull_int_test.go index b4ff02e38d..c4c589ef89 100644 --- a/test/integration/pull_int_test.go +++ b/test/integration/pull_int_test.go @@ -24,7 +24,7 @@ func (suite *PullIntegrationTestSuite) TestPull() { ts := e2e.New(suite.T(), false) defer ts.Close() - ts.PrepareProject("ActiveState-CLI/Python3", "") + ts.PrepareProject("ActiveState-CLI/Python3", "59404293-e5a9-4fd0-8843-77cd4761b5b5") cp := ts.Spawn("pull") cp.Expect("Operating on project") diff --git a/test/integration/push_int_test.go b/test/integration/push_int_test.go index c72f41b3d6..d00af970e3 100644 --- a/test/integration/push_int_test.go +++ b/test/integration/push_int_test.go @@ -264,24 +264,6 @@ func (suite *PushIntegrationTestSuite) TestPush_NoChanges() { } } -func (suite *PushIntegrationTestSuite) TestPush_NoCommit() { - suite.OnlyRunForTags(tagsuite.Push) - - ts := e2e.New(suite.T(), false) - defer ts.Close() - - ts.PrepareProject("ActiveState-CLI/cli", "") - - ts.LoginAsPersistentUser() - cp := ts.SpawnWithOpts(e2e.OptArgs("push")) - cp.Expect("nothing to push") - cp.ExpectExitCode(1) - - if strings.Count(cp.Snapshot(), " x ") != 1 { - suite.Fail("Expected exactly ONE error message, got: ", cp.Snapshot()) - } -} - func (suite *PushIntegrationTestSuite) TestPush_NameInUse() { suite.OnlyRunForTags(tagsuite.Push)