When using a /tree/<branch>/<path-to-commit> style path, then <branch> should be used and not HEAD. As long as <path-to-commit> exists in <branch> it should be returned.
I have encountered an issue that violates the above acceptance criteria. I have a commit that exists in branch A but not branch B. Attempting to access a file added in this commit with branch A checked out working fine, however attempting to access the file with branch B checked out causes an exception.
17:35:14,931 WARN [org.modeshape.connector.git.GitConnector] (default task-22) Cannot read commit "src/lib/jquery.min.js"
17:35:14,932 ERROR [stderr] (default task-22) javax.jcr.PathNotFoundException: The child "jcr:content" could not be found under "/nogece/tree/master/src/lib/jquery.min.js" in workspace "default"