mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
Fix path display of empty Git repos
This commit is contained in:
parent
b28bc7ae64
commit
3f0a8241fc
1 changed files with 7 additions and 4 deletions
|
@ -1221,15 +1221,18 @@ ref<SourceAccessor> GitRepoImpl::getAccessor(const WorkdirInfo & wd, bool export
|
|||
since that would allow access to all its children). */
|
||||
ref<SourceAccessor> fileAccessor =
|
||||
wd.files.empty()
|
||||
? makeEmptySourceAccessor()
|
||||
? ({
|
||||
auto empty = makeEmptySourceAccessor();
|
||||
empty->setPathDisplay(path.string());
|
||||
empty;
|
||||
})
|
||||
: AllowListSourceAccessor::create(
|
||||
makeFSSourceAccessor(path),
|
||||
std::set<CanonPath> { wd.files },
|
||||
std::move(makeNotAllowedError)).cast<SourceAccessor>();
|
||||
if (exportIgnore)
|
||||
return make_ref<GitExportIgnoreSourceAccessor>(self, fileAccessor, std::nullopt);
|
||||
else
|
||||
return fileAccessor;
|
||||
fileAccessor = make_ref<GitExportIgnoreSourceAccessor>(self, fileAccessor, std::nullopt);
|
||||
return fileAccessor;
|
||||
}
|
||||
|
||||
ref<GitFileSystemObjectSink> GitRepoImpl::getFileSystemObjectSink()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue