We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 25b7c74 + e501465 commit c3e95abCopy full SHA for c3e95ab
core/git_command.py
@@ -681,7 +681,17 @@ def _find_git_toplevel(self, folder):
681
repo_path = search_for_git_toplevel(folder)
682
if repo_path:
683
util.debug.dprint("repo path:", os.path.join(repo_path, ".git"))
684
- repo_paths[folder] = repo_path
+ # Check if we followed links, as `paths_upwards` is only a string operation,
685
+ # then fill the cache upwards.
686
+ if folder.startswith(repo_path):
687
+ for p in paths_upwards(folder):
688
+ if p in repo_paths:
689
+ break
690
+ repo_paths[p] = repo_path
691
+ if p == repo_path:
692
693
+ else:
694
+ repo_paths[folder] = repo_path
695
else:
696
util.debug.dprint("found no .git path for {}".format(folder))
697
return repo_path
0 commit comments