Feature #51222 » 0009-scripts-ceph-backport.sh-move-number-of-commits-code.patch
ceph-backport.sh | ||
---|---|---|
info "Cowardly refusing to perform automated cherry-pick"
|
||
false
|
||
fi
|
||
number_of_commits=$(echo "${remote_api_output}" | jq '.commits')
|
||
if [ "$number_of_commits" -eq "$number_of_commits" ] 2>/dev/null ; then
|
||
# \$number_of_commits is set, and is an integer
|
||
if [ "$number_of_commits" -eq "1" ] ; then
|
||
singular_or_plural_commit="commit"
|
||
else
|
||
singular_or_plural_commit="commits"
|
||
fi
|
||
else
|
||
error "Could not determine the number of commits in ${original_pr_url}"
|
||
bail_out_github_api "$remote_api_output"
|
||
fi
|
||
info "Found $number_of_commits $singular_or_plural_commit in $original_pr_url"
|
||
set -x
|
||
git fetch "$upstream_remote"
|
||
... | ... | |
git fetch "$upstream_remote" "pull/$original_pr/head:pr-$original_pr"
|
||
number_of_commits=$(echo "${remote_api_output}" | jq '.commits')
|
||
if [ "$number_of_commits" -eq "$number_of_commits" ] 2>/dev/null ; then
|
||
# \$number_of_commits is set, and is an integer
|
||
if [ "$number_of_commits" -eq "1" ] ; then
|
||
singular_or_plural_commit="commit"
|
||
else
|
||
singular_or_plural_commit="commits"
|
||
fi
|
||
else
|
||
error "Could not determine the number of commits in ${original_pr_url}"
|
||
bail_out_github_api "$remote_api_output"
|
||
fi
|
||
info "Found $number_of_commits $singular_or_plural_commit in $original_pr_url"
|
||
set +x
|
||
maybe_restore_set_x
|
||
info "Attempting to cherry pick $number_of_commits commits from ${original_pr_url} into local branch $local_branch"
|