Skip to content

Commit

Permalink
pr changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnro314 committed Jan 30, 2024
1 parent f275d41 commit 21fedf3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ components:
allow_empty:
type: boolean
default: false
description: allow reverts without any changes
description: allow empty commit (revert without changes)

CherryPickCreation:
type: object
Expand Down
4 changes: 2 additions & 2 deletions cmd/lakectl/cmd/branch_revert.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const (
branchRevertCmdArgs = 2
ParentNumberFlagName = "parent-number"
allowEmptyRevert = "allow-empty-revert"
allowEmptyRevert = "allow-empty-commit"
)

// lakectl branch revert lakefs://myrepo/main commitId
Expand Down Expand Up @@ -61,7 +61,7 @@ func init() {
AssignAutoConfirmFlag(branchRevertCmd.Flags())

branchRevertCmd.Flags().IntP(ParentNumberFlagName, "m", 0, "the parent number (starting from 1) of the mainline. The revert will reverse the change relative to the specified parent.")
branchRevertCmd.Flags().Bool(allowEmptyRevert, false, "allow revert with no changes")
branchRevertCmd.Flags().Bool(allowEmptyRevert, false, "allow empty commit (revert without changes)")

branchCmd.AddCommand(branchRevertCmd)
}
2 changes: 1 addition & 1 deletion pkg/catalog/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ type RevertParams struct {
Reference string // the commit to revert
ParentNumber int // if reverting a merge commit, the change will be reversed relative to this parent number (1-based).
Committer string
AllowEmpty bool // allow revert with no changes
AllowEmpty bool // allow empty commit (revert without changes)
}

type CherryPickParams struct {
Expand Down
1 change: 0 additions & 1 deletion pkg/graveler/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ var (
ErrSkipValueUpdate = errors.New("skip value update")
ErrImport = wrapError(ErrUserVisible, "import error")
ErrReadOnlyRepository = wrapError(ErrUserVisible, "read-only repository")
ErrEmptyRevert = wrapError(ErrUserVisible, "revert with no changes")
)

// wrappedError is an error for wrapping another error while ignoring its message.
Expand Down
2 changes: 1 addition & 1 deletion pkg/graveler/graveler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ func (g *Graveler) Revert(ctx context.Context, repository *RepositoryRecord, bra
// merge from the parent to the top of the branch, with the given ref as the merge base:
metaRangeID, err := g.CommittedManager.Merge(ctx, repository.StorageNamespace, branchCommit.MetaRangeID, parentMetaRangeID, commitRecord.MetaRangeID, MergeStrategyNone)
if (metaRangeID == branchCommit.MetaRangeID) && !commitParams.AllowEmpty {
return nil, ErrEmptyRevert
return nil, ErrNoChanges
}
if err != nil {
if !errors.Is(err, ErrUserVisible) {
Expand Down

0 comments on commit 21fedf3

Please sign in to comment.