Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 in '<commit not on master>' of repo 'https://github.com/owner/myrepo' on ref 'master'! ``` Closes NixOS#2431
- Loading branch information