Skip to content

Commit

Permalink
Use 'Everything up-to-date' language consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
macneale4 committed Jul 26, 2024
1 parent a12c16b commit bb7e104
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions go/cmd/dolt/commands/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ func (cmd MergeCmd) Exec(ctx context.Context, commandStr string, args []string,
return 1
}
if upToDate {
// Git CLI language.
cli.Println("Already up to date.")
// dolt uses "Everything up-to-date" message, but Git CLI uses "Already up to date".
cli.Println(doltdb.ErrUpToDate.Error())
return 0
}

Expand Down Expand Up @@ -729,7 +729,7 @@ func everythingUpToDate(row sql.Row) (bool, error) {

if hash, ok := row[hashColumn].(string); ok {
if msg, ok := row[msgColumn].(string); ok {
if hash == "" && msg == "Everything up-to-date" {
if hash == "" && msg == doltdb.ErrUpToDate.Error() { // "Everything up-to-date" message.
return true, nil
}
} else {
Expand Down
1 change: 1 addition & 0 deletions go/libraries/doltcore/doltdb/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var ErrAlreadyOnWorkspace = errors.New("Already on workspace")

var ErrNomsIO = errors.New("error reading from or writing to noms")

// ErrUpToDate is returned when a merge is up-to-date. Not actually an error, and we do use this message in non-error contexts.
var ErrUpToDate = errors.New("Everything up-to-date")
var ErrIsAhead = errors.New("cannot fast forward from a to b. a is ahead of b already")
var ErrIsBehind = errors.New("cannot reverse from b to a. b is a is behind a already")
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/bats/shallow-clone.bats
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ seed_and_start_serial_remote() {
dolt checkout main
run dolt merge other
[ "$status" -eq 0 ]
[[ "$output" =~ "Already up to date" ]] || false
[[ "$output" =~ "Everything up-to-date" ]] || false
}

@test "shallow-clone: push to a new remote should error" {
Expand Down

0 comments on commit bb7e104

Please sign in to comment.