summaryrefslogtreecommitdiffstats
path: root/src/libexpr/flake/flake.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-02-05 15:31:16 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-02-05 15:31:16 +0100
commit750c993f004952685e3c06ffd222c6fe3b710c85 (patch)
treebba3a2a2cbc484d16f9396c2bb918d546e01fb7a /src/libexpr/flake/flake.cc
parent9d7fb62db6e8ee6da7f8dbc5f5509271dc12f2ba (diff)
Improve commit subject line
Diffstat (limited to 'src/libexpr/flake/flake.cc')
-rw-r--r--src/libexpr/flake/flake.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc
index 5f64b76d9..055ff6321 100644
--- a/src/libexpr/flake/flake.cc
+++ b/src/libexpr/flake/flake.cc
@@ -572,7 +572,9 @@ LockedFlake lockFlake(
if (!lockFlags.updateLockFile)
throw Error("flake '%s' requires lock file changes but they're not allowed due to '--no-update-lock-file'", topRef);
- auto path = *sourcePath + (topRef.subdir == "" ? "" : "/" + topRef.subdir) + "/flake.lock";
+ auto relPath = (topRef.subdir == "" ? "" : topRef.subdir + "/") + "flake.lock";
+
+ auto path = *sourcePath + "/" + relPath;
bool lockFileExists = pathExists(path);
@@ -586,7 +588,8 @@ LockedFlake lockFlake(
topRef.input->markChangedFile(
(topRef.subdir == "" ? "" : topRef.subdir + "/") + "flake.lock",
lockFlags.commitLockFile
- ? std::optional<std::string>(fmt("flake.lock: %s\n\nFlake input changes:\n\n%s", lockFileExists ? "Update" : "Add", diff))
+ ? std::optional<std::string>(fmt("%s: %s\n\nFlake input changes:\n\n%s",
+ relPath, lockFileExists ? "Update" : "Add", diff))
: std::nullopt);
/* Rewriting the lockfile changed the top-level