Page MenuHomePhabricator

Only load refs that are actual commits
ClosedPublic

Authored by avivey on Jul 8 2016, 9:24 PM.
Tags
None
Referenced Files
F14053668: D16261.diff
Fri, Nov 15, 6:07 PM
F14042164: D16261.diff
Tue, Nov 12, 1:02 AM
F14031841: D16261.id39118.diff
Sat, Nov 9, 12:03 PM
F14031840: D16261.id39117.diff
Sat, Nov 9, 12:03 PM
F14031839: D16261.id39116.diff
Sat, Nov 9, 12:03 PM
F14031838: D16261.id.diff
Sat, Nov 9, 12:03 PM
F14030252: D16261.id39116.diff
Sat, Nov 9, 1:02 AM
F14025865: D16261.diff
Thu, Nov 7, 8:55 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.