summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-01-10 12:30:37 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-01-10 15:54:32 +0100
commit3e6ba85cacea36cfbebdbea4d5e96c5f068cb990 (patch)
treeaadf2caba7bd52019c92ad1bc2e856cdf079f826 /bin
parentb97c58a9a0eb4494208ec99ea73676354fd203a2 (diff)
downloadjustbuild-3e6ba85cacea36cfbebdbea4d5e96c5f068cb990.tar.gz
just-import-git: carry out the temporary clone in a shallow way
Diffstat (limited to 'bin')
-rwxr-xr-xbin/just-import-git.py4
1 files changed, 1 insertions, 3 deletions
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,))