Page MenuHomeFreeBSD

git-arc: Fix find_author() for external users
ClosedPublic

Authored by jlduran on Sep 25 2024, 5:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 5:18 AM
Unknown Object (File)
Nov 16 2024, 2:26 PM
Unknown Object (File)
Nov 15 2024, 5:17 PM
Unknown Object (File)
Nov 15 2024, 3:07 PM
Unknown Object (File)
Nov 7 2024, 9:20 PM
Unknown Object (File)
Nov 5 2024, 6:30 AM
Unknown Object (File)
Oct 21 2024, 10:57 PM
Unknown Object (File)
Oct 11 2024, 3:02 AM
Subscribers
None

Details

Summary

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()

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable