Project.pm: validate new HEAD setting
commitf8987b38523bb9d1a81cb682e0ffb222f15a0644
authorKyle J. McKay <mackyle@gmail.com>
Thu, 31 Mar 2016 01:18:28 +0000 (30 18:18 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Thu, 31 Mar 2016 01:18:28 +0000 (30 18:18 -0700)
tree8174ea453d73b45982768ac71cf7862aa0992fe1
parent8f17a52ee7b2dc8fc29d11418f8aeb631ec9a24f
Project.pm: validate new HEAD setting

Validate the new setting for HEAD.  The new setting must be
a valid refs/heads/... item OR the same as the current HEAD
setting.

And while we're in there, if the current get_heads list
would be empty and a HEAD is currently defined, add that
to the list to avoid an empty popup.

With these changes the HEAD popup on the editproj.cgi
form should never be empty and it's no longer possible
to manually stuff a value in the form result to set
arbitrary refs/heads/... HEAD values.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/Project.pm