lix/src/libfetchers
Maximilian Bosch 04daff94e3
libfetchers/git: restore compat with builtins.fetchGit from 2.3
Since fb38459d6e, each `ref` is appended
with `refs/heads` unless it starts with `refs/` already. This regressed
two use-cases that worked fine before:

* Specifying a commit hash as `ref`: now, if `ref` looks like a commit
  hash it will be directly passed to `git fetch`.

* Specifying a tag without `refs/tags` as prefix: now, the fetcher prepends
  `refs/*` to a ref that doesn't start with `refs/` and doesn't look
  like a commit hash. That way, both a branch and a tag specified in
  `ref` can be fetched.

  The order of preference in git is

  * file in `refs/` (e.g. `HEAD`)
  * file in `refs/tags/`
  * file in `refs/heads` (i.e. a branch)

  After fetching `refs/*`, ref is resolved the same way as git does.

Change-Id: Idd49b97cbdc8c6fdc8faa5a48bef3dec25e4ccc3
2024-09-28 14:52:06 +02: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 libfetchers: serialise accept-flake-config properly 2024-09-02 18:50:15 +02:00
fetch-settings.hh libfetchers: serialise accept-flake-config properly 2024-09-02 18:50:15 +02:00
fetch-to-store.cc refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -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 refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -07:00
fetchers.hh tree-wide: shuffle headers around for about 30s compile time 2024-08-28 09:55:05 -07:00
git.cc libfetchers/git: restore compat with builtins.fetchGit from 2.3 2024-09-28 14:52:06 +02:00
github.cc refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -07:00
indirect.cc refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -07:00
lix-fetchers.pc.in packaging: rename nixexpr -> lixexpr and so on 2024-05-23 16:45:23 -06:00
mercurial.cc refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -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 refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -07:00