diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-01-10 12:30:37 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-01-10 15:54:32 +0100 |
commit | 3e6ba85cacea36cfbebdbea4d5e96c5f068cb990 (patch) | |
tree | aadf2caba7bd52019c92ad1bc2e856cdf079f826 /bin | |
parent | b97c58a9a0eb4494208ec99ea73676354fd203a2 (diff) | |
download | justbuild-3e6ba85cacea36cfbebdbea4d5e96c5f068cb990.tar.gz |
just-import-git: carry out the temporary clone in a shallow way
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/just-import-git.py | 4 |
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,)) |