Page MenuHomePhabricator

Only load refs that are actual commits
ClosedPublic

Authored by avivey on Jul 8 2016, 9:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 4, 12:54 AM
Unknown Object (File)
Wed, Apr 3, 3:35 AM
Unknown Object (File)
Tue, Apr 2, 8:38 PM
Unknown Object (File)
Tue, Apr 2, 8:28 PM
Unknown Object (File)
Tue, Apr 2, 2:58 PM
Unknown Object (File)
Fri, Mar 29, 8:19 PM
Unknown Object (File)
Wed, Mar 27, 5:14 PM
Unknown Object (File)
Mar 9 2024, 10:58 PM
Subscribers

Details

Summary

Fix T11301. Git is git.

Test Plan

tagged a file! run discover. no crash.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avivey retitled this revision from to Only load refs that are actual commits.
avivey updated this object.
avivey edited the test plan for this revision. (Show Details)
avivey added a reviewer: epriestley.
$ git for-each-ref --format='%(refname) %(objectname), %(objecttype), %(*objecttype)'
refs/heads/master 5230675b77c5d67380c2a8aba715398c5ee1db9c, commit,
refs/tags/annotate 1043ce6092f54480a22223752823aafa8e548d7c, tag, commit
refs/tags/tag-of-file d077588c31c154f2544980bd4fd37ece0136020b, blob,

I couldn't tag a tag though.

I would expect the $ref_type check to cause us to incorrectly skip checking normal tags (of commits), but we do want to discover commits that are reachable from only tags. Am I misunderstanding that?

I intended to say that "If objecttype is a commit, or if objecttype is tag that points to (*objecttype) a commit, then handle it".

Then I flipped all the conditions.

I'm going to update the GT unit test to include all these edges.

avivey edited edge metadata.
  • update test

In the new GT.git.tgz:

$ git for-each-ref
763d4ab372445551c95fb5cccd1a7a223f5b2ac8 commit refs/heads/master
41fa35914aa19c1aa6e57004d9745c05929c3563 commit refs/tags/plain-tag
270e6739dc7e08a5f2f1fdd7bf188ca64eaeda32 blob   refs/tags/tag-a-blob

41fa35914aa19c1aa6e57004d9745c05929c3563 is a commit that is only reachable from the plan tag; It's parent is 763d4ab372445551c95fb5cccd1a7a223f5b2ac8, which is master.

This revision is now accepted and ready to land.Jul 8 2016, 9:54 PM
This revision was automatically updated to reflect the committed changes.