lix/src/libfetchers
Maximilian Bosch 87fd1f024c Reapply "libfetchers: make attribute / URL query handling consistent"
The original attempt at this introduced a regression; this commit
reverts the revert and fixes the regression.

This reverts commit 3e151d4d77.

Fix to the regression:

flakeref: fix handling of `?dir=` param for flakes in subdirs

As reported in #419[1], accessing a flake in a subdir of a Git
repository fails with the previous commit[2] applied with the error

    error: unsupported Git input attribute 'dir'

The problem is that the `dir`-param is inserted into the parsed URL if a
flake is fetched from the subdir of a Git repository. However, for the
fetching part this isn't even needed. The fix is to just pass `subdir`
as second argument to `FlakeRef` (which needs a `basedir` that can be
empty) and leave the parsedURL as-is.

Added a regression test to make sure we don't run into this again.

[1] https://git.lix.systems/lix-project/lix/issues/419
[2] e22172aaf6b6a366cecd3c025590e68fa2b91bcc,
    originally 3e151d4d77

Change-Id: I2c72d5a32e406a7ca308e271730bd0af01c5d18b
2024-08-01 15:41:30 -07:00
..
attrs.cc Fix conversion from JSON to fetch attributes 2021-01-05 02:06:25 +00:00
attrs.hh Allow tarball URLs to redirect to a lockable immutable URL 2023-06-13 14:17:45 +02:00
cache.cc util.{hh,cc}: Split out users.{hh,cc} 2024-05-29 11:01:34 +02:00
cache.hh Input: Replace markFileChanged() by putFile() 2024-03-25 15:30:36 +00:00
fetch-settings.cc libexpr/flake: allow automatic rejection of configuration options from flakes 2024-06-30 19:28:14 +02:00
fetch-settings.hh libexpr/flake: allow automatic rejection of configuration options from flakes 2024-06-30 19:28:14 +02:00
fetch-to-store.cc Merge pull request #9634 from 9999years/combine-abstract-pos-and-pos 2024-03-05 23:46:18 -07:00
fetch-to-store.hh util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
fetchers.cc libfetchers: fix URL logging 2024-05-25 19:37:38 -06:00
fetchers.hh Reapply "libfetchers: make attribute / URL query handling consistent" 2024-08-01 15:41:30 -07:00
git.cc Reapply "libfetchers: make attribute / URL query handling consistent" 2024-08-01 15:41:30 -07:00
github.cc Reapply "libfetchers: make attribute / URL query handling consistent" 2024-08-01 15:41:30 -07:00
indirect.cc Reapply "libfetchers: make attribute / URL query handling consistent" 2024-08-01 15:41:30 -07:00
lix-fetchers.pc.in packaging: rename nixexpr -> lixexpr and so on 2024-05-23 16:45:23 -06:00
mercurial.cc Reapply "libfetchers: make attribute / URL query handling consistent" 2024-08-01 15:41:30 -07:00
meson.build build: expose option to enable or disable precompiled std headers 2024-06-06 12:46:26 -06:00
path.cc libstore: convert dumpPath to a generator 2024-07-05 22:28:16 +00:00
registry.cc util.{hh,cc}: Split out users.{hh,cc} 2024-05-29 11:01:34 +02:00
registry.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
tarball.cc Reapply "libfetchers: make attribute / URL query handling consistent" 2024-08-01 15:41:30 -07:00