Skip to content

CLI merge -s reports success when the merge stopped on conflicts #21

Closed

Description

@dnnsjsk

pitmaster merge -s <strategy> <branch> ignores the merge result and always prints Merge successful. with exit code 0 (

pitmaster/bin/pitmaster

Lines 562 to 569 in 5beb97d

if ($args[0] === '-s') {
if (isset($args[1], $args[2]) && in_array($args[1], ['ours', 'ort', 'recursive'], true)) {
$result = $repo->merge($args[2], $args[1]);
fwrite(STDOUT, "Merge successful.\n");
return;
}
). When the merge stops on conflicts, the conflict state is written but the CLI reports success. Without -s, the same situation prints CONFLICT in: ... and exits with 1 (

pitmaster/bin/pitmaster

Lines 575 to 582 in 5beb97d

$result = count($args) > 1 ? $repo->mergeOctopus($args) : $repo->merge($args[0]);
if ($result->clean) {
fwrite(STDOUT, "Merge successful.\n");
} else {
fwrite(STDERR, "CONFLICT in: " . implode(', ', $result->conflictPaths) . "\n");
exit(1);
}
).

Repro

# main and feature both change line 1 of a.txt
pitmaster merge -s recursive feature   # "Merge successful.", exit 0
pitmaster status                       # Unmerged paths: a.txt

Expected

Report conflicts and exit with 1 for -s merges as for the default path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions