Files
lix/tests
Maximilian Bosch f742438465 Merge legacy fetchGit-builtin with the generic fetchTree-function
The original idea was to implement a git-fetcher in Nix's core that
supports content hashes[1]. In #3549[2] it has been suggested to
actually use `fetchTree` for this since it's a fairly generic wrapper
over the new fetcher-API[3] and already supports content-hashes.

This patch implements a new git-fetcher based on `fetchTree` by
incorporating the following changes:

* Removed the original `fetchGit`-implementation and replaced it with an
  alias on the `fetchTree` implementation.

* Ensured that the `git`-fetcher from `libfetchers` always computes a
  content-hash and returns an "empty" revision on dirty trees (the
  latter one is needed to retain backwards-compatibility).

* The hash-mismatch error in the fetcher-API exits with code 102 as it
  usually happens whenever a hash-mismatch is detected by Nix.

* Removed the `flakes`-feature-flag: I didn't see a reason why this API
  is so tightly coupled to the flakes-API and at least `fetchGit` should
  remain usable without any feature-flags.

* It's only possible to specify a `narHash` for a `git`-tree if either a
  `ref` or a `rev` is given[4].

* It's now possible to specify an URL without a protocol. If it's missing,
  `file://` is automatically added as it was the case in the original
  `fetchGit`-implementation.

[1] https://github.com/NixOS/nix/pull/3216
[2] https://github.com/NixOS/nix/pull/3549#issuecomment-625194383
[3] https://github.com/NixOS/nix/pull/3459
[4] https://github.com/NixOS/nix/pull/3216#issuecomment-553956703
2020-07-28 00:44:39 +02:00
..
2020-04-14 18:45:06 +02:00
2020-03-30 15:30:19 +02:00
2019-12-13 19:05:26 +01:00
2018-08-06 14:06:54 +02:00
2014-08-21 21:50:19 +02:00
2020-07-03 09:20:01 +02:00
2020-04-14 18:45:06 +02:00
2016-08-10 18:05:35 +02:00
2018-02-13 14:26:19 +00:00
2014-08-21 21:50:19 +02:00
2018-02-03 10:08:05 +01:00
2016-09-12 13:40:07 +02:00
2019-03-10 01:50:33 +01:00
2006-07-21 13:21:43 +00:00
2018-12-13 14:30:52 +01:00
2019-07-25 09:44:01 -04:00
2014-08-21 21:50:19 +02:00
2020-07-17 15:50:53 -04:00
2020-07-17 15:50:53 -04:00
2020-06-30 16:43:01 -06:00
2018-02-13 14:26:19 +00:00
2020-07-03 13:16:22 +02:00
2019-11-27 00:05:30 +01:00
2018-01-16 19:23:18 +01:00
2019-11-27 00:05:30 +01:00
2019-11-26 20:12:15 +01:00
2018-01-16 19:23:18 +01:00
2019-11-27 00:05:30 +01:00
2018-02-25 16:40:05 -06:00
2020-04-20 15:27:09 +02:00
2016-04-11 16:20:15 +02:00
2020-05-01 12:17:53 +02:00
2020-05-01 12:17:53 +02:00
2007-08-13 13:15:02 +00:00
2016-10-19 15:19:38 +02:00
2019-07-02 11:18:36 -04:00
2012-12-04 14:47:50 +01:00
2012-12-04 14:47:50 +01:00