Skip to content

Commit

Permalink
Merge pull request #323 from lonemadmax/git-init-outside
Browse files Browse the repository at this point in the history
GitRepository: update on external init
  • Loading branch information
nexus6-haiku authored Feb 15, 2024
2 parents 68867f5 + 6706f79 commit 9bc78a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/git/GitRepository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ namespace Genio::Git {
bool
GitRepository::IsInitialized()
{
// if the repository gets corrupted or the .git folder is deleted, we need to check the
// status again and put the repository in an uninitialized state
if (!GitRepository::IsValid(fRepositoryPath)) {
// If the repository gets corrupted or the .git folder is deleted, we need to check the
// status again and put the repository in an uninitialized state.
// If it was not initialized but it is valid now, it may have been initialized externally.
if (!GitRepository::IsValid(fRepositoryPath) || !fInitialized) {
fInitialized = false;
// Let's make an attempt to reopen the repository if necessary
_Open();
Expand Down

0 comments on commit 9bc78a1

Please sign in to comment.