From 138a98698dc76ea207c746f82db50eac70255755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Wed, 16 Aug 2023 10:13:47 +0100 Subject: [PATCH] support .devenv.flake.nix using git 2, include git untracked files --- src/libfetchers/git-utils.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index 2998575ffc9..e874011e331 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -291,6 +291,8 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this git_status_options options = GIT_STATUS_OPTIONS_INIT; options.flags |= GIT_STATUS_OPT_INCLUDE_UNMODIFIED; + options.flags |= GIT_STATUS_OPT_INCLUDE_UNTRACKED; + options.flags |= GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS; options.flags |= GIT_STATUS_OPT_EXCLUDE_SUBMODULES; if (git_status_foreach_ext(*this, &options, &statusCallbackTrampoline, &statusCallback)) throw Error("getting working directory status: %s", git_error_last()->message); @@ -300,6 +302,10 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this if (pathExists(modulesFile)) info.submodules = parseSubmodules(modulesFile); + // Usually ignored, so add it manually + if (pathExists(".devenv.flake.nix")) { + info.files.insert(CanonPath(path)); + } return info; }