HomeFreeBSD

git-arc: Fix find_author() for external users

Description

git-arc: Fix find_author() for external users

When an external user submits a review in Phabricator, the find_author()
subroutine may receive the author_name and author_addr as "null" from
the JSON API with git-arc patch.

This "null" string gets tested for length by "[ -n", and returning that
is greater than zero, in other words, the shell does not understand that
"null" means nothing in this case.

Fix it by adding a guard, that sets an empty string when the content is
"null".

While here, standardize the indentation style for find_author()

Reviewed by: emaste, markj
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D46789

Details

Provenance
jlduranAuthored on Nov 5 2024, 1:32 AM
Reviewer
emaste
Differential Revision
D46789: git-arc: Fix find_author() for external users
Parents
rGb032be711c74: Make the CTL tests more resilient
Branches
Unknown
Tags
Unknown