Skip to content

Correctly delete single repo, not all repos.

In a recent commit, I cleaned up the code which deletes repo. At that point, instead of maybe concatenating strings together, sometimes with an AND statement, it was changed to use the slightly better QuerySelection. This class is preferable because it doesn't need the developer to know whether there was any previous constraints, and thus it knows whether to prepend an AND.

The problem arose because QuerySelection is effectively an immutable class. Calling add() on it returns a new copy with a different set of constraints. The code which deleted the repo did not use this copy, and thus the resulting query had zero constraints.

The fix is to use the return value of add() correctly. It would've been easier to identify this bug if we had a lint check for "unused return values", though it is likely that that would get annoying very quickly.

Fixes #717 (closed).

Merge request reports