Skip to content
  • Z.J. van de Weg's avatar
    fd220a3c
    Implement RepositoryExists request and response · fd220a3c
    Z.J. van de Weg authored
    Needed to perform this request was only the helper already implemented,
    however this one method RepoPath(), first checked the storage,
    constructed a path, guarded against path traversal, and checked if the
    path passed was a git repo. My implementation tries to split these concern
    without changing the API for now.
    
    The request can only respond with an `InvalidArgument` error code. If it
    returns an error, the `Exists` property is not set. In other
    cases it checks if the directory has the `objects` folder and `HEAD`
    file.
    fd220a3c
    Implement RepositoryExists request and response
    Z.J. van de Weg authored
    Needed to perform this request was only the helper already implemented,
    however this one method RepoPath(), first checked the storage,
    constructed a path, guarded against path traversal, and checked if the
    path passed was a git repo. My implementation tries to split these concern
    without changing the API for now.
    
    The request can only respond with an `InvalidArgument` error code. If it
    returns an error, the `Exists` property is not set. In other
    cases it checks if the directory has the `objects` folder and `HEAD`
    file.
Loading