From 1fc855711b7a0a514c3c9a178b1cd8b0a67cec27 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 19 May 2026 03:17:55 +0000 Subject: [PATCH] feat(run): log git clone command with flags and branch information --- registry/coder/modules/git-clone/main.test.ts | 4 ++++ registry/coder/modules/git-clone/run.sh | 2 ++ 2 files changed, 6 insertions(+) diff --git a/registry/coder/modules/git-clone/main.test.ts b/registry/coder/modules/git-clone/main.test.ts index 4a30aa4f..0327417a 100644 --- a/registry/coder/modules/git-clone/main.test.ts +++ b/registry/coder/modules/git-clone/main.test.ts @@ -59,6 +59,7 @@ describe("git-clone", async () => { expect(output.stdout).toEqual([ "Creating directory /root/fake-url...", "Cloning fake-url to /root/fake-url...", + "Running: git clone fake-url /root/fake-url", ]); expect(output.stderr.join(" ")).toContain("fatal"); expect(output.stderr.join(" ")).toContain("fake-url"); @@ -235,6 +236,7 @@ describe("git-clone", async () => { expect(output.stdout).toEqual([ "Creating directory /root/repo-tests.log...", "Cloning https://github.com/michaelbrewer/repo-tests.log to /root/repo-tests.log on branch feat/branch...", + "Running: git clone -b feat/branch https://github.com/michaelbrewer/repo-tests.log /root/repo-tests.log", ]); }); @@ -248,6 +250,7 @@ describe("git-clone", async () => { expect(output.stdout).toEqual([ "Creating directory /root/repo-tests.log...", "Cloning https://gitlab.com/mike.brew/repo-tests.log to /root/repo-tests.log on branch feat/branch...", + "Running: git clone -b feat/branch https://gitlab.com/mike.brew/repo-tests.log /root/repo-tests.log", ]); }); @@ -269,6 +272,7 @@ describe("git-clone", async () => { expect(output.stdout).toEqual([ "Creating directory /root/repo-tests.log...", "Cloning https://github.com/michaelbrewer/repo-tests.log to /root/repo-tests.log on branch feat/branch...", + "Running: git clone -b feat/branch https://github.com/michaelbrewer/repo-tests.log /root/repo-tests.log", ]); }); diff --git a/registry/coder/modules/git-clone/run.sh b/registry/coder/modules/git-clone/run.sh index fb0d83b8..db0fb373 100644 --- a/registry/coder/modules/git-clone/run.sh +++ b/registry/coder/modules/git-clone/run.sh @@ -65,9 +65,11 @@ fi if [ -z "$(ls -A "$CLONE_PATH")" ]; then if [ -z "$BRANCH_NAME" ]; then echo "Cloning $REPO_URL to $CLONE_PATH..." + echo "Running: git clone $${CLONE_FLAGS[*]} $REPO_URL $CLONE_PATH" git clone "$${CLONE_FLAGS[@]}" "$REPO_URL" "$CLONE_PATH" else echo "Cloning $REPO_URL to $CLONE_PATH on branch $BRANCH_NAME..." + echo "Running: git clone $${CLONE_FLAGS[*]} -b $BRANCH_NAME $REPO_URL $CLONE_PATH" git clone "$${CLONE_FLAGS[@]}" -b "$BRANCH_NAME" "$REPO_URL" "$CLONE_PATH" fi else