summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
authorAlex Good <alex@memoryandthought.me>2021-05-02 13:41:59 +0100
committerAlex Good <alex@memoryandthought.me>2021-06-11 17:58:36 +0100
commit1713ab45510ceeae06d8d3f75e6e4b71a7630658 (patch)
treea1dd18f5bf315ef28b9f1553d4d3c075080fd71b /src/remote.c
parent1ee3c37f48479e92f57c1a5da8c8393f4a745d13 (diff)
downloadlibgit2-1713ab45510ceeae06d8d3f75e6e4b71a7630658.tar.gz
Respect the force flag on refspecs in git_remote_fetch
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/remote.c b/src/remote.c
index 5f6ba5bf7..d17c38951 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1460,6 +1460,9 @@ static int update_tips_for_spec(
if (error < 0 && error != GIT_ENOTFOUND)
goto on_error;
+ if (!error && !spec->force && !git_graph_descendant_of(remote->repo, &head->oid, &old))
+ continue;
+
if (error == GIT_ENOTFOUND) {
memset(&old, 0, GIT_OID_RAWSZ);