Compare commits

...

6 Commits

Author SHA1 Message Date
Adrien Bernede
b2e526678a
Merge branch 'develop' into woptim/extend-commit-fetch 2023-02-27 16:15:46 +01:00
Adrien M. BERNEDE
ecdde4a7fb Remove shallow clone fetch 2023-02-27 11:48:58 +01:00
Adrien M. BERNEDE
cbf2cb1a49 Fix wrong syntax 2023-02-27 11:36:06 +01:00
Adrien M. BERNEDE
5de57e6450 Missing repository arg 2023-02-27 11:29:09 +01:00
Adrien M. BERNEDE
a5d71af83a Attempt at getting the commit with a fetch 2023-02-27 11:27:23 +01:00
Adrien M. BERNEDE
9331d47808 Add a step that forces the fetch of the specific commit
This will fetch even if the commit is on a PR from a fork
2023-02-23 16:38:58 +01:00
2 changed files with 7 additions and 0 deletions

View File

@ -862,6 +862,9 @@ def clone(self, dest=None, commit=None, branch=None, tag=None, bare=False):
)
with working_dir(dest):
# By defaults, on all references are fetched by the clone
fetch_args = ["fetch", "origin", commit]
git(*fetch_args)
checkout_args = ["checkout", commit]
if not debug:
checkout_args.insert(1, "--quiet")

View File

@ -1336,6 +1336,10 @@ def lookup_ref(self, ref):
# won't properly update the local rev-list)
self.fetcher.git("fetch", "--tags", output=os.devnull, error=os.devnull)
# We need to do an attempt at fetching the commit in order to
# be sure to get it in case it comes from a PR in a fork.
self.fetcher.git("fetch", "origin", "%s" % ref, output=os.devnull, error=os.devnull)
# Ensure ref is a commit object known to git
# Note the brackets are literals, the ref replaces the format string
try: