Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
soramimi committed Jan 27, 2025
1 parent 980db4a commit af62174
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1725,11 +1725,11 @@ void MainWindow::openRepository(OpenRepositoyOption const &opt)
if (r == QMessageBox::Ok) {
removeSelectedRepositoryFromBookmark(false);
}
return;
goto done;
}
if (!Git::isValidWorkingCopy(dir)) {
QMessageBox::warning(this, tr("Open Repository"), tr("Not a valid git repository") + "\n\n" + dir);
return;
goto done;
}
}

Expand All @@ -1738,16 +1738,21 @@ void MainWindow::openRepository(OpenRepositoyOption const &opt)
opt2.validate = false;
opt2.waitcursor = false;
openRepository(opt2);
return;
goto done;
}

GitPtr g = git();
if (!g) {
qDebug() << "Guitar: git pointer is null";
return;
{
GitPtr g = git();
if (!g) {
qDebug() << "Guitar: git pointer is null";
goto done;
}

internalOpenRepository(g, true, opt.keep_selection);
}

internalOpenRepository(g, true, opt.keep_selection);
done:;
clearAllFilter();
}

void MainWindow::reopenRepository(bool validate)
Expand Down Expand Up @@ -1783,8 +1788,6 @@ void MainWindow::openSelectedRepository()
{
std::optional<RepositoryData> repo = selectedRepositoryItem();

clearAllFilter();

if (repo) {
setCurrentRepository(*repo, true);
reopenRepository(true);
Expand Down Expand Up @@ -1868,8 +1871,6 @@ void MainWindow::internalAfterFetch()
GitPtr g = git();
updateRemoteInfo(g);
onUpdateCommitLog();

qDebug() << Q_FUNC_INFO;
}

#define RUN_PTY_CALLBACK [this](ProcessStatus const &status, QVariant const &userdata)
Expand Down Expand Up @@ -5399,7 +5400,8 @@ GitPtr MainWindow::git()

GitPtr MainWindow::git(const Git::SubmoduleItem &submod)
{
if (!submod) return {};
//// if (!submod) return {};
// ↑submodが無効でもnullではないオブジェクトを返す
RepositoryData const &item = currentRepository();
return git(item.local_dir, submod.path, item.ssh_key);
}
Expand Down

0 comments on commit af62174

Please sign in to comment.