Implement validation for "repository add"

fixes #7458