Skip to content

Commit 7f6933f

Browse files
committed
add case for empty repo
1 parent f7c06a9 commit 7f6933f

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"hermione": "hermione",
88
"selenium": "selenium-standalone install && selenium-standalone start",
99
"test": "npm run mocha && npm run hermione",
10-
"clone": "git clone --mirror https://github.com/voronin-ivan/test.git repo",
10+
"clone": "rm -rf repo && git clone --mirror https://github.com/voronin-ivan/blabla.git repo",
1111
"build": "webpack",
1212
"dev": "webpack --watch | nodemon index.js",
1313
"start": "NODE_ENV=production npm run build && node index.js"

server/router.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ router.get('/:branch', async (req, res) => {
4444

4545
router.get('/:branch/:commit', async (req, res) => {
4646
const { commit, branch } = req.params;
47-
const file = req.query.file;
48-
const path = req.query.path;
47+
const { file, path } = req.query;
4948

5049
if (file) {
5150
return res.render('preview', {

server/views/index.pug

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ block content
33
header
44
h1.title Branches
55
main
6-
ul.list
7-
for branch in branches
8-
li.list__item
9-
a(href=`/${branch}`) #{branch}
6+
if (branches[0])
7+
ul.list
8+
for branch in branches
9+
li.list__item
10+
a(href=`/${branch}`) #{branch}
11+
else
12+
h2 Repository is empty

0 commit comments

Comments
 (0)