From 3e6ba85cacea36cfbebdbea4d5e96c5f068cb990 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 10 Jan 2023 12:30:37 +0100 Subject: just-import-git: carry out the temporary clone in a shallow way --- bin/just-import-git.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'bin/just-import-git.py') diff --git a/bin/just-import-git.py b/bin/just-import-git.py index 51603696..c061bc74 100755 --- a/bin/just-import-git.py +++ b/bin/just-import-git.py @@ -116,11 +116,9 @@ def clone(url, branch): # clone the given git repository, checkout the specified # branch, and return the checkout location workdir = tempfile.mkdtemp() - run_cmd(["git", "clone", url, "src"], + run_cmd(["git", "clone", "-b", branch, "--depth", "1", url, "src"], cwd=workdir) srcdir = os.path.join(workdir, "src") - run_cmd(["git", "checkout", branch], - cwd = srcdir) commit = run_cmd(["git", "log", "-n", "1", "--pretty=%H"], cwd = srcdir, stdout=subprocess.PIPE).decode('utf-8').strip() log("Importing commit %s" % (commit,)) -- cgit v1.2.3