Fix two issues with ref discovery
Summary: See IRC. I'm having trouble figuring out what's going on with b4taylor's report, but fix two possible issues: # The commit query is missing a `repositoryID`, which could cause issues if you import two copies of the same repository. # I think we may try to close commits on untracked branches right now, as long as they aren't excluded by other autoclose rules. Test Plan: Ran `bin/repository refs` on a few repos. Reviewers: btrahan Reviewed By: btrahan CC: aran, brennantaylor Differential Revision: https://secure.phabricator.com/D8373
This commit is contained in:
		| @@ -304,8 +304,9 @@ final class PhabricatorRepositoryRefEngine | ||||
|     $all_commits = queryfx_all( | ||||
|       $conn_w, | ||||
|       'SELECT id, commitIdentifier, importStatus FROM %T | ||||
|         WHERE commitIdentifier IN (%Ls)', | ||||
|         WHERE repositoryID = %d AND commitIdentifier IN (%Ls)', | ||||
|       $commit_table->getTableName(), | ||||
|       $repository->getID(), | ||||
|       $identifiers); | ||||
|  | ||||
|     $closeable_flag = PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE; | ||||
|   | ||||
| @@ -592,6 +592,10 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO | ||||
|       return false; | ||||
|     } | ||||
|  | ||||
|     if (!$this->shouldTrackBranch($branch)) { | ||||
|       return false; | ||||
|     } | ||||
|  | ||||
|     return $this->isBranchInFilter($branch, 'close-commits-filter'); | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 epriestley
					epriestley