Skip to content

Commit

Permalink
Merge pull request #2841 from ActiveState/mitchell/dx-2277-2
Browse files Browse the repository at this point in the history
Lack of having a commit ID for package operations is an error.
  • Loading branch information
mitchell-as authored Oct 31, 2023
2 parents c3faef4 + 79d2522 commit 15eb4b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/runbits/requirements/requirements.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (r *RequirementOperation) ExecuteRequirementOperation(requirementName, requ
switch nsType {
case model.NamespacePackage, model.NamespaceBundle:
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")
}

Expand Down Expand Up @@ -191,7 +191,7 @@ func (r *RequirementOperation) ExecuteRequirementOperation(requirementName, requ
}

parentCommitID, err := localcommit.Get(r.Project.Dir())
if err != nil && !localcommit.IsFileDoesNotExistError(err) {
if err != nil {
return errs.Wrap(err, "Unable to get local commit")
}
hasParentCommit := parentCommitID != ""
Expand Down
5 changes: 5 additions & 0 deletions test/integration/package_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,11 @@ func (suite *PackageIntegrationTestSuite) TestJSON() {
cp.ExpectExitCode(0)
AssertValidJSON(suite.T(), cp)

cp = ts.Spawn("checkout", "ActiveState-CLI/Perl-5.32", ".")
cp.Expect("Skipping runtime setup")
cp.Expect("Checked out project")
cp.ExpectExitCode(0)

cp = ts.SpawnWithOpts(
e2e.OptArgs("checkout", "ActiveState-CLI/Packages-Perl", "."),
e2e.OptAppendEnv("ACTIVESTATE_CLI_DISABLE_RUNTIME=false"),
Expand Down

0 comments on commit 15eb4b9

Please sign in to comment.