1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-09 03:43:54 +02:00

Merge pull request #2582 from LnL7/fetchgit-refs

fetchGit: allow fetching explicit refs
This commit is contained in:
Eelco Dolstra 2019-07-02 15:44:31 +02:00 committed by GitHub
commit 33db1d35ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 1 deletions

View file

@ -425,6 +425,13 @@ stdenv.mkDerivation { … }
This is often a branch or tag name. Defaults to
<literal>HEAD</literal>.
</para>
<para>
By default, the <varname>ref</varname> value is prefixed
with <literal>refs/heads/</literal>. As of Nix 2.3.0
Nix will not prefix <literal>refs/heads/</literal> if
<varname>ref</varname> starts with <literal>refs/</literal>.
</para>
</listitem>
</varlistentry>
</variablelist>
@ -438,6 +445,14 @@ stdenv.mkDerivation { … }
}</programlisting>
</example>
<example>
<title>Fetching an arbitrary ref</title>
<programlisting>builtins.fetchGit {
url = "https://gitub.com/NixOS/nix.git";
ref = "refs/heads/0.5-release";
}</programlisting>
</example>
<example>
<title>Fetching a repository's specific commit on an arbitrary branch</title>
<para>