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
F109829504: D46789.id143727.diff
Mon, Feb 10, 1:45 AM
F109829334: D46789.id146033.diff
Mon, Feb 10, 1:42 AM
Unknown Object (File)
Sat, Feb 8, 7:35 PM
Unknown Object (File)
Sat, Feb 8, 1:55 PM
Unknown Object (File)
Thu, Feb 6, 3:59 PM
Unknown Object (File)
Tue, Jan 14, 7:19 PM
Unknown Object (File)
Jan 10 2025, 6:15 PM
Unknown Object (File)
Dec 9 2024, 5:18 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