diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index 06a2f85be84..ceb0b353927 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -2565,7 +2565,7 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs() case FileIngestionMethod::Git: { return git::dumpHash( outputHash.hashAlgo, - {getFSSourceAccessor(), CanonPath(tmpDir + "/tmp")}).hash; + {getFSSourceAccessor(), CanonPath(actualPath)}).hash; } } assert(false); diff --git a/tests/functional/fixed.nix b/tests/functional/fixed.nix index a920a21671f..9f1ef3b61fe 100644 --- a/tests/functional/fixed.nix +++ b/tests/functional/fixed.nix @@ -66,4 +66,7 @@ rec { # Can use "nar" instead of "recursive" now. nar-not-recursive = f2 "foo" ./fixed.builder2.sh "nar" "md5" "3670af73070fa14077ad74e0f5ea4e42"; + + # Experimental feature + git = f2 "foo" ./fixed.builder2.sh "git" "sha1" "cd44baf36915d5dec8374232ea7e2057f3b4494e"; } diff --git a/tests/functional/git-hashing/fixed.sh b/tests/functional/git-hashing/fixed.sh new file mode 100644 index 00000000000..1962472a876 --- /dev/null +++ b/tests/functional/git-hashing/fixed.sh @@ -0,0 +1,6 @@ +source common.sh + +# Store layer needs bugfix +requireDaemonNewerThan "2.27pre20250122" + +nix-build ../fixed.nix -A git --no-out-link diff --git a/tests/functional/git-hashing/meson.build b/tests/functional/git-hashing/meson.build index 470c53fc5bb..d6a782cdccf 100644 --- a/tests/functional/git-hashing/meson.build +++ b/tests/functional/git-hashing/meson.build @@ -3,6 +3,7 @@ suites += { 'deps': [], 'tests': [ 'simple.sh', + 'fixed.sh', ], 'workdir': meson.current_source_dir(), }