Skip to content

Conversation

@koudis
Copy link
Contributor

@koudis koudis commented Jan 11, 2026

I have two branches BRANCH_A and BRANCH_MODULES, where BRANCH_A does not contain git submodules, and BRANCH_MODULES has several private/unaccessible submodules for the user who tries to access them.

Let BRANCH_MODULES be set up as the default git branch. Then Packager fails with "Cannot access" because it clones whole repository by the standard git clone, which checks out to the default branch (BRANCH_MODULES) and then to a BRANCH_A

I suggest adding option --no-checkout t ogit clone.

"Git": {
    "URI": "<nice_uri>",
    "Revision": "BRANCH_A"
  }

Summary by CodeRabbit

  • Bug Fixes
    • Modified repository cloning behavior to skip automatic working-tree checkout during clone operations.
    • Clones now preserve an uninitialized working state after download, allowing callers to perform checkout or initialization steps explicitly when needed.

✏️ Tip: You can customize this high-level summary in your review settings.

@koudis koudis requested a review from mikusaq January 11, 2026 16:38
@coderabbitai
Copy link

coderabbitai bot commented Jan 11, 2026

📝 Walkthrough

Walkthrough

The git clone flag in GitClone.ConstructCMDLine was changed from --recursive to --no-checkout, and the corresponding test expectation in internal/git/default_test.go was updated to match.

Changes

Cohort / File(s) Summary
Git clone implementation
internal/git/Git.go
Replaced --recursive with --no-checkout in GitClone.ConstructCMDLine, changing clone behavior to skip initial checkout.
Test update
internal/git/default_test.go
Updated TestGitClone_ConstructCMDLine expected command to reflect the flag change from --recursive to --no-checkout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny hop, a flag undone,
From recursive runs to checkout none,
I nibble code beneath the moon,
Awaiting builders to resume soon. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "No checkout after clone" accurately reflects the main change: replacing --recursive with --no-checkout flag in git clone command to prevent automatic checkout of the default branch.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @internal/git/Git.go:
- Line 39: The test in internal/git/default_test.go expects the old
"--recursive" flag but the implementation in internal/git/Git.go now uses
"--no-checkout"; update the test's validCmdLine (the validCmdLine variable in
default_test.go) to replace "--recursive" with "--no-checkout" so the expected
command matches the new clone behavior used by the build flow (clone without
checkout → explicit checkout → submodule update).
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9bbf951 and 79d0e5f.

📒 Files selected for processing (1)
  • internal/git/Git.go

@mikusaq mikusaq merged commit 3b12f72 into master Jan 26, 2026
2 checks passed
@mikusaq mikusaq deleted the jan_kubalek/no_checkout_after_clone branch January 26, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants