Fix existence test in "reconcile.php"
Summary: "rev-parse --verify" is actually a terrible test, it only survived my test cases because I put garbage into the tables with RAND() or similar, not properly-formatted garbage. Use "cat-file -t" instead to ensure we perform an object-existence test. Test Plan: Ran "reconcile.php P" locally, ran "cat-file -t" and "rev-parse --verify" on properly-formatted but invalid hashes like "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", worked with @rguerin to resolve commit issues. Reviewers: btrahan, rguerin Reviewed By: rguerin CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1590
This commit is contained in:
		@@ -88,8 +88,11 @@ try {
 | 
			
		||||
echo "Verifying commits (this may take some time if the repository is large)";
 | 
			
		||||
$futures = array();
 | 
			
		||||
foreach ($all_commits as $id => $commit) {
 | 
			
		||||
  // NOTE: We use "cat-file -t", not "rev-parse --verify", because
 | 
			
		||||
  // "rev-parse --verify" does not verify that the object actually exists, only
 | 
			
		||||
  // that the name is properly formatted.
 | 
			
		||||
  $futures[$id] = $repository->getLocalCommandFuture(
 | 
			
		||||
    'rev-parse --verify %s',
 | 
			
		||||
    'cat-file -t %s',
 | 
			
		||||
    $commit->getCommitIdentifier());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user