1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 20:30:05 +02:00

handle no git repo case

This commit is contained in:
s2
2018-05-19 15:38:53 +02:00
parent 7a6c320ddf
commit eca9796be7
3 changed files with 16 additions and 3 deletions

View File

@@ -6,6 +6,10 @@
$('.js-container').html(gitlit.templates.main({files: files}));
});
ipcRenderer.on('isNoGitLfsRepo', (event, repoDir) => {
$('.js-container').html(gitlit.templates.isNoGitLfsRepo({repoDir: repoDir}));
});
ipcRenderer.on('notification', (event, notification) => {
if (notification.message) {
var notice = PNotify.alert({

View File

@@ -38,5 +38,10 @@ gitlit.templates = {
Refresh
</a>
</div>
`)
`),
isNoGitLfsRepo: ejs.compile(`
<div class="alert alert-danger">
<%= repoDir %> is not a git lfs repo.
</div>
`)
};

View File

@@ -103,12 +103,16 @@ function createWindow() {
getLfsFileList(repoDir, (err, files) => {
if (err) {
console.error(err);
process.exit(1);
win.webContents.send('isNoGitLfsRepo', repoDir);
return;
}
getLfsLocks(repoDir, (err, lockedFiles) => {
if (err) {
console.error(err);
process.exit(1);
win.webContents.send('isNoGitLfsRepo', repoDir);
return;
}
let allFiles = [];