Fix T11301. Git is git.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T11301: git tags can tag anything, break daemons
- Commits
- rPc56a4fce6615: Only load refs that are actual commits
tagged a file! run discover. no crash.
Diff Detail
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
$ 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.
Comment Actions
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?
Comment Actions
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.
Comment Actions
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.