Skip to content

Commit

Permalink
support .devenv.flake.nix using git 2, include git untracked files
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Feb 16, 2024
1 parent 748567b commit 138a986
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libfetchers/git-utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>

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);
Expand All @@ -300,6 +302,10 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
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;
}

Expand Down

0 comments on commit 138a986

Please sign in to comment.