From 90c520ab5f3aa5586dce29c06221d41cb07e2ef4 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Thu, 21 Mar 2024 01:38:03 +0000 Subject: [PATCH] generate_source_tarball.sh: Only add --depth=1 on non-local repositories Related: RHEL-30946 --- generate_source_tarball.sh | 8 +++++++- java-21-openjdk.spec | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 32d4b35..6279670 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -213,7 +213,13 @@ else mkdir "${FILE_NAME_ROOT}" pushd "${FILE_NAME_ROOT}" echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" - git clone --depth=1 -b "${VERSION}" "${REPO_ROOT}" "${VERSION}" + if realpath -q "${REPO_ROOT}"; then + echo "Local path detected; not adding depth argument"; + else + DEPTH="--depth=1"; + echo "Remote repository detected; adding ${DEPTH}"; + fi + git clone ${DEPTH} -b "${VERSION}" "${REPO_ROOT}" "${VERSION}" pushd "${VERSION}" TAR_TIME="$(git log --max-count 1 --format=%cI)" popd diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec index 0c16f7c..f3b5080 100644 --- a/java-21-openjdk.spec +++ b/java-21-openjdk.spec @@ -2539,6 +2539,7 @@ cjc.mainProgram(args) - generate_source_tarball.sh: Update examples in header for clarity - generate_source_tarball.sh: Cleanup message issued when checkout already exists - generate_source_tarball.sh: Create directory in TMPDIR when using WITH_TEMP +- generate_source_tarball.sh: Only add --depth=1 on non-local repositories - Related: RHEL-30946 * Sun Apr 14 2024 Andrew Hughes - 1:21.0.3.0.1-0.1.ea