diff options
author | Stan Hu <stanhu@gmail.com> | 2015-07-22 01:01:03 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-07-22 01:01:03 +0000 |
commit | f593b621e3d4b3da31a2e48dd53a96d60dde6cd0 (patch) | |
tree | b553985902225a726d011faea559fd83bdc4b56d /doc/gitlab-basics/create-your-ssh-keys.md | |
parent | 815cf7f84309f28af3561e1c9b49d1fa35719c7f (diff) | |
parent | 643557dabccbb3a503b0867ae44ec5701759d2a8 (diff) | |
download | gitlab-ce-f593b621e3d4b3da31a2e48dd53a96d60dde6cd0.tar.gz |
Merge branch 'fix-404-empty-repo' into 'master'
Fix 404 error in files view after deleting the last file in a repository
Here's the logic:
1. In `TreeController`, `require_non_empty_project` will prevent `show` from being called if the project is empty. That means all calls to `show` will be guaranteed to have at least 1 commit.
2. If the ref name is not valid, then return a 404. This ensures that at least the controller is looking at a valid branch/tag/SHA ID.
3. This leaves a number of cases:
```
3a. Valid ref, valid directory
3b. Valid ref, valid filename
3c. Valid ref, invalid path
3d. Valid ref, no files
```
Case 3a: The tree will not be `empty?` and will pass through the whole function.
Case 3b: The tree will be `empty?` but the `blob_at` will resolve properly and trigger a redirect to the file.
Case 3c: In this case, a path is given. Return 404 if it cannot be resolved neither as a tree nor a blob.
Case 3d: In this case, no path is given. If the tree is empty, this means it's an empty branch and just fall through.
Example broken branch: https://gitlab.com/gitlab-org/gitlab-test/tree/empty-branch
Closes #1362
See merge request !1010
Diffstat (limited to 'doc/gitlab-basics/create-your-ssh-keys.md')
0 files changed, 0 insertions, 0 deletions