mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 16:23:02 +00:00
github: Respect default branch
This commit is contained in:
parent
5d69bbf3fe
commit
3d492199bb
@ -137,7 +137,7 @@ struct GitArchiveInputScheme : InputScheme
|
|||||||
{
|
{
|
||||||
Input input(_input);
|
Input input(_input);
|
||||||
|
|
||||||
if (!maybeGetStrAttr(input.attrs, "ref")) input.attrs.insert_or_assign("ref", "master");
|
if (!maybeGetStrAttr(input.attrs, "ref")) input.attrs.insert_or_assign("ref", "HEAD");
|
||||||
|
|
||||||
auto rev = input.getRev();
|
auto rev = input.getRev();
|
||||||
if (!rev) rev = getRevFromRef(store, input);
|
if (!rev) rev = getRevFromRef(store, input);
|
||||||
@ -217,7 +217,7 @@ struct GitHubInputScheme : GitArchiveInputScheme
|
|||||||
auto host_url = maybeGetStrAttr(input.attrs, "url").value_or("github.com");
|
auto host_url = maybeGetStrAttr(input.attrs, "url").value_or("github.com");
|
||||||
Input::fromURL(fmt("git+ssh://git@%s/%s/%s.git",
|
Input::fromURL(fmt("git+ssh://git@%s/%s/%s.git",
|
||||||
host_url, getStrAttr(input.attrs, "owner"), getStrAttr(input.attrs, "repo")))
|
host_url, getStrAttr(input.attrs, "owner"), getStrAttr(input.attrs, "repo")))
|
||||||
.applyOverrides(input.getRef().value_or("master"), input.getRev())
|
.applyOverrides(input.getRef().value_or("HEAD"), input.getRev())
|
||||||
.clone(destDir);
|
.clone(destDir);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -262,7 +262,7 @@ struct GitLabInputScheme : GitArchiveInputScheme
|
|||||||
// FIXME: get username somewhere
|
// FIXME: get username somewhere
|
||||||
Input::fromURL(fmt("git+ssh://git@%s/%s/%s.git",
|
Input::fromURL(fmt("git+ssh://git@%s/%s/%s.git",
|
||||||
host_url, getStrAttr(input.attrs, "owner"), getStrAttr(input.attrs, "repo")))
|
host_url, getStrAttr(input.attrs, "owner"), getStrAttr(input.attrs, "repo")))
|
||||||
.applyOverrides(input.getRef().value_or("master"), input.getRev())
|
.applyOverrides(input.getRef().value_or("HEAD"), input.getRev())
|
||||||
.clone(destDir);
|
.clone(destDir);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -56,7 +56,7 @@ let
|
|||||||
tar cfz $out/tarball/${nixpkgs.rev} $dir --hard-dereference
|
tar cfz $out/tarball/${nixpkgs.rev} $dir --hard-dereference
|
||||||
|
|
||||||
mkdir -p $out/commits
|
mkdir -p $out/commits
|
||||||
echo '{"sha": "${nixpkgs.rev}"}' > $out/commits/master
|
echo '{"sha": "${nixpkgs.rev}"}' > $out/commits/HEAD
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
|
Loading…
Reference in New Issue
Block a user