diff --git a/patches/issues-305.patch b/patches/issues-305.patch new file mode 100644 index 0000000..0d30ce2 --- /dev/null +++ b/patches/issues-305.patch @@ -0,0 +1,30 @@ +From d29b60df7c069d6341e40ff205e0caebbaeb1bb4 Mon Sep 17 00:00:00 2001 +From: Raymond Augé +Date: Thu, 29 Sep 2022 13:48:50 -0400 +Subject: object not found when trying to pull a repository cloned with Depth: + 1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +fixes #305 + +Signed-off-by: Raymond Augé + +diff --git a/remote.go b/remote.go +index db78ae7..00f0050 100644 +--- a/remote.go ++++ b/remote.go +@@ -1060,6 +1060,12 @@ func isFastForward(s storer.EncodedObjectStorer, old, new plumbing.Hash) (bool, + found = true + return storer.ErrStop + }) ++ ++ // Shallow clones may lead to a commit where the parent is absent ++ // resulting in plumbing.ErrObjectNotFound. ++ if err == plumbing.ErrObjectNotFound { ++ return found, nil ++ } + return found, err + } + diff --git a/vendor/github.com/go-git/go-git/v5/remote.go b/vendor/github.com/go-git/go-git/v5/remote.go index 4a06106..418cb29 100644 --- a/vendor/github.com/go-git/go-git/v5/remote.go +++ b/vendor/github.com/go-git/go-git/v5/remote.go @@ -892,6 +892,12 @@ func isFastForward(s storer.EncodedObjectStorer, old, new plumbing.Hash) (bool, found = true return storer.ErrStop }) + + // Shallow clones may lead to a commit where the parent is absent + // resulting in plumbing.ErrObjectNotFound. + if err == plumbing.ErrObjectNotFound { + return found, nil + } return found, err }