aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/github.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-09-14 13:38:45 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-09-14 13:38:45 +0200
commit07996c481081d729d3ff1a53932e66c713ef5af2 (patch)
tree00551b80f8f1dd184c8f117bf6d0daa6685d93ea /src/libfetchers/github.cc
parentd72d31d5294586943ef9fb7d13706f629837bf21 (diff)
github fetcher: Don't use HEAD branch when cloning
Fixes #4394.
Diffstat (limited to 'src/libfetchers/github.cc')
-rw-r--r--src/libfetchers/github.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libfetchers/github.cc b/src/libfetchers/github.cc
index 06b56d60d..da759addf 100644
--- a/src/libfetchers/github.cc
+++ b/src/libfetchers/github.cc
@@ -275,7 +275,7 @@ struct GitHubInputScheme : GitArchiveInputScheme
auto host = maybeGetStrAttr(input.attrs, "host").value_or("github.com");
Input::fromURL(fmt("git+https://%s/%s/%s.git",
host, getStrAttr(input.attrs, "owner"), getStrAttr(input.attrs, "repo")))
- .applyOverrides(input.getRef().value_or("HEAD"), input.getRev())
+ .applyOverrides(input.getRef(), input.getRev())
.clone(destDir);
}
};
@@ -343,7 +343,7 @@ struct GitLabInputScheme : GitArchiveInputScheme
// FIXME: get username somewhere
Input::fromURL(fmt("git+https://git@%s/%s/%s.git",
host, getStrAttr(input.attrs, "owner"), getStrAttr(input.attrs, "repo")))
- .applyOverrides(input.getRef().value_or("HEAD"), input.getRev())
+ .applyOverrides(input.getRef(), input.getRev())
.clone(destDir);
}
};