mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 13:14:59 +00:00
code_review: PR #1103
Since we only use `$GIT_COMMON_DIR` in filesystem watcher, it is unnecessary to store this value in `Repository`, and we can query the `$GIT_COMMON_DIR` only when it looks like a worktree Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
cea8a90680
commit
b4ab4afd3a
4 changed files with 16 additions and 17 deletions
|
@ -282,7 +282,6 @@ namespace SourceGit.ViewModels
|
|||
|
||||
var isBare = new Commands.IsBareRepository(node.Id).Result();
|
||||
var gitDir = node.Id;
|
||||
var gitCommonDir = gitDir;
|
||||
if (!isBare)
|
||||
{
|
||||
gitDir = new Commands.QueryGitDir(node.Id).Result();
|
||||
|
@ -292,12 +291,9 @@ namespace SourceGit.ViewModels
|
|||
App.RaiseException(ctx, "Given path is not a valid git repository!");
|
||||
return;
|
||||
}
|
||||
gitCommonDir = new Commands.QueryGitCommonDir(node.Id).Result();
|
||||
if (string.IsNullOrEmpty(gitCommonDir))
|
||||
gitCommonDir = gitDir;
|
||||
}
|
||||
|
||||
var repo = new Repository(isBare, node.Id, gitDir, gitCommonDir);
|
||||
var repo = new Repository(isBare, node.Id, gitDir);
|
||||
repo.Open();
|
||||
|
||||
if (page == null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue