eclipse-jgit / jgit

JGit, the Java implementation of git
https://www.eclipse.org/jgit/
Other
149 stars 41 forks source link

Incorrect hiderefs Behavior #109

Open joelthompson opened 4 days ago

joelthompson commented 4 days ago

Version

master

Operating System

Linux/Unix

Bug description

According to the Git documentation, there are three ways hideRefs can be set:

  1. transfer.hideRefs: This hides the refs from both receive-pack and upload-pack commands
  2. uploadpack.hideRefs: This hides the ref from only upload-pack but leaves it visible for receive-pack commands
  3. receive.hideRefs: The opposite of the above: hide the ref only from receive-pack commands but leave it visible for upload-pack commands.

JGit only looks at uploadpack.hiderefs and ignores transfer.hiderefs and receive.hiderefs https://github.com/eclipse-jgit/jgit/blob/a903ab5fa3defdef06b4eba316ef2436533416fb/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java#L213 Further, when uploadpack.hiderefs is set; JGit acts as if transfer.hiderefs had been set instead and hides the listed refs from both receive-pack and upload-pack.

The net result of this is there's no way to use hideRefs to hide a ref from only upload-pack or receive-pack.

Actual behavior

transfer.hiderefs and receive.hiderefs are both ignored; uploadpack.hiderefs acts the way transfer.hiderefs should.

Expected behavior

transfer.hiderefs, receive.hiderefs, and uploadpack.hiderefs to behave as describe in the Git documentation.

Relevant log output

No response

Other information

Not sure it's material, but the Git docs specify hideRefs with a capital R while JGit looks at hiderefs with a lower-case r

msohn commented 4 days ago

git config keys are case insensitive