lix/src/libfetchers
Maximilian Bosch 629af83b2d
Provide a more meaningful error-message for builtins.fetchGit if a revision can't be checked out
A common pitfall when using e.g. `builtins.fetchGit` is the `fatal: not
a tree object`-error when trying to fetch a revision of a git-repository
that isn't on the `master` branch and no `ref` is specified.

In order to make clear what's the problem, I added a simple check
whether the revision in question exists and if it doesn't a more
meaningful error-message is displayed:

```
nix-repl> builtins.fetchGit { url = "https://github.com/owner/myrepo"; rev = "<commit not on master>"; }
moderror: --- Error -------------------------------------------------------------------- nix
Cannot find Git revision 'bf1cc5c648e6aed7360448a3745bb2fe4fbbf0e9' in ref 'master' of repository 'https://gitlab.com/Ma27/nvim.nix'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.
```

Closes #2431
2020-12-22 10:46:00 +01:00
..
attrs.cc Capitalize JSON for consistency 2020-10-28 17:54:28 -05:00
attrs.hh Capitalize JSON for consistency 2020-10-28 17:54:28 -05:00
cache.cc Capitalize JSON for consistency 2020-10-28 17:54:28 -05:00
cache.hh Shut up a clang warning 2020-07-03 14:50:07 +02:00
fetchers.cc Capitalize JSON for consistency 2020-10-28 17:54:28 -05:00
fetchers.hh Merge pull request #4080 from kquick/kwq/flake-int-doc 2020-10-19 11:29:12 +02:00
git.cc Provide a more meaningful error-message for builtins.fetchGit if a revision can't be checked out 2020-12-22 10:46:00 +01:00
github.cc Shut up some clang warnings 2020-10-06 14:52:30 +02:00
indirect.cc Remove static variable name clashes 2020-10-06 13:49:20 +02:00
local.mk StorePath: Rewrite in C++ 2020-06-16 14:28:41 +02:00
mercurial.cc fetchMercurial: set HGPLAIN when invoking hg 2020-11-23 16:12:33 +00:00
path.cc Remove static variable name clashes 2020-10-06 13:49:20 +02:00
registry.cc Capitalize JSON for consistency 2020-10-28 17:54:28 -05:00
registry.hh Remove TreeInfo 2020-05-30 00:44:11 +02:00
tarball.cc Remove static variable name clashes 2020-10-06 13:49:20 +02:00