Skip to content

Stop calling ExtractsRef#tree with ref_type when using sha

Jerry Seto requested to merge avoid-ref-type-for-tree-with-sha into master

What does this MR do and why?

The ref_type parameter should be not be used for the tree method when the ref is a sha for a commit. It causes the ref that is actually used to look up tree entries to be incorrect

The ref_type parameter should be used when a request with a ref name and ref_type to:

  • create a fully qualified ref
  • provided context during serialization about whether the ref is a branch or a tag.

This change is to stop calling tree with ref_type erroneously 😬

How to set up and validate locally

  1. create a project
  2. create file in a directory (e.g mkdir test && touch test/test)
  3. commit the file and push the changes to a branch (e.g git add test/test && git commit -m "test" && git push origin main)
  4. see that the directory is there (e.g http://gdk.test/root/test-project/-/tree/main/test)
  5. see that the directory is there when providing ref_type (e.g http://gdk.test/root/test-project/-/tree/main/test?ref_type=heads)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports