Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistPatchWorkflow.php
Context not available. | |||||
$base_name .= "-D{$revision_id}"; | $base_name .= "-D{$revision_id}"; | ||||
} | } | ||||
$suffixes = array(null, '_1', '_2', '_3'); | $proposed_suffix = null; | ||||
foreach ($suffixes as $suffix) { | while(!$branch_name) { | ||||
speck: I think the linter would've requested there to be a space between `while` and open paren | |||||
$proposed_name = $base_name.$suffix; | $proposed_name = "{$base_name}_{$proposed_suffix}"; | ||||
0Unsubmitted Not Done Inline ActionsWill this result in "{$base_name}_" rather than "{$base_name}" as the first proposed branch name? 0: Will this result in `"{$base_name}_"` rather than `"{$base_name}"` as the first proposed branch… | |||||
speckUnsubmitted Not Done Inline ActionsYea I think this would result in the first non-collision attempt always being suffixed with underscore. The naive approach here would be if ($proposed_suffix == null) { $proposed_name = $base_name; } else { $proposed_name = "{$base_name}_{$proposed_suffix}"; } speck: Yea I think this would result in the first non-collision attempt always being suffixed with… | |||||
list($err) = $repository_api->execManualLocal( | list($err) = $repository_api->execManualLocal( | ||||
'rev-parse --verify %s', | 'rev-parse --verify %s', | ||||
Context not available. | |||||
pht( | pht( | ||||
'Branch name %s already exists; trying a new name.', | 'Branch name %s already exists; trying a new name.', | ||||
$proposed_name)); | $proposed_name)); | ||||
$proposed_suffix = $proposed_suffix + 1; | |||||
0Unsubmitted Not Done Inline ActionsThis can be just $proposed_suffix++. 0: This can be just `$proposed_suffix++`. | |||||
continue; | continue; | ||||
} else { | } else { | ||||
$branch_name = $proposed_name; | $branch_name = $proposed_name; | ||||
Context not available. |
I think the linter would've requested there to be a space between while and open paren