devel/arcanist-lib: Handle NULL argument passed to strlen()
Problem description: - ArcanistDiffWorkflow.php:getDiffOntoTargets() tries to determine the current branch name by calling ArcanistGitAPI.php:getBranchName() - getBranchName() returns NULL when working on a detached HEAD - getDiffOntoTargets() calls strlen() with the branch name, which now fails with a NULL argument. Approved by: grembo (maintainer) Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
5d0279df7a
commit
3b71507307
@ -1,6 +1,6 @@
|
||||
PORTNAME?= arcanist
|
||||
PORTVERSION?= 20220518
|
||||
PORTREVISION?= 2
|
||||
PORTREVISION?= 3
|
||||
CATEGORIES?= devel
|
||||
PKGNAMESUFFIX= ${SLAVE_PKGNAMESUFFIX}${PHP_PKGNAMESUFFIX}
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
--- src/workflow/ArcanistDiffWorkflow.php.orig 2023-01-09 21:24:25 UTC
|
||||
+++ src/workflow/ArcanistDiffWorkflow.php
|
||||
@@ -2361,7 +2361,7 @@ EOTEXT
|
||||
|
||||
// If we track an upstream branch either directly or indirectly, use that.
|
||||
$branch = $api->getBranchName();
|
||||
- if (strlen($branch)) {
|
||||
+ if (strlen($branch ?? '')) {
|
||||
$upstream_path = $api->getPathToUpstream($branch);
|
||||
$remote_branch = $upstream_path->getRemoteBranchName();
|
||||
if ($remote_branch !== null) {
|
Loading…
Reference in New Issue
Block a user