gogs / go-gogs-client

Gogs API client in Go.
MIT License
233 stars 145 forks source link

Object hash support #85

Closed gdewald closed 7 years ago

gdewald commented 7 years ago

Are there any plans to support object hashes (rather than commit hashes) when referring to raw content via the repository contents API?

gdewald commented 7 years ago

Working on adding support.

I've also found a bug. If you send a valid non-commit object (e.g. blob) hash sum there is an exception.

Steps to repro:

  1. Find git object ID by running git ls-tree head and selecting any object ID (hash sum)
  2. Call api/v1/repos/admin123/test/raw/<shasum>/<filepath>

Root cause is that git show works with all types of object IDs, but the output of non-commit objects is unexpected to the parser and results in an exception.

gdewald commented 7 years ago

Closing issue to move to appropriate repos