Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ To create a shallow clone of a large repo, use `-j`:

```sh
# Clone dwilding's fork of https://github.com/juju/juju and
# create a branch called update-docs, cloning with --shallow-since
# create a branch called update-docs, cloning with limited history
gimmegit -j -u juju dwilding/juju update-docs
```

Expand Down
5 changes: 4 additions & 1 deletion src/gimmegit/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ def check_branch_not_taken(clone_url: str, branch: str) -> None:


def clone(context: Context, jumbo: bool, extra_args: list[str]) -> None:
logger.info(f"Cloning {context.clone_url}")
if jumbo:
logger.info(f"Cloning {context.clone_url} with limited history")
else:
logger.info(f"Cloning {context.clone_url}")
context.clone_dir.parent.mkdir(exist_ok=True)
if context.create_branch:
check_branch_not_taken(context.clone_url, context.branch)
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def test_jumbo(uv_run, test_dir):
expected_dir = test_dir / "juju/dwilding-my-feature"
expected_stdout = f"""\
Getting repo details
Cloning https://github.com/dwilding/juju.git
Cloning https://github.com/dwilding/juju.git with limited history
Setting upstream to https://github.com/juju/juju.git
Checking out a new branch my-feature based on juju:main
Cloned repo:
Expand Down
9 changes: 8 additions & 1 deletion tests/functional/test_git_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ def test_invalid_repo(uv_run, test_dir, askpass_env, args: list[str]):
text=True,
)
assert result.returncode == 1
expected_stdout = """\
expected_stdout = (
"""\
Getting repo details
Cloning https://github.com/dwilding/invalid.git with limited history
"""
if args[0] == "-j"
else """\
Comment on lines +43 to +49
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

The expected stdout branch condition only checks args[0] == "-j", so it won’t cover the --jumbo long option (and will also break if -j/--jumbo isn’t the first arg). Consider detecting jumbo via membership (e.g., "-j" in args or "--jumbo" in args) and adding a --jumbo case so the updated output is exercised for both forms of the flag.

Copilot uses AI. Check for mistakes.
Getting repo details
Cloning https://github.com/dwilding/invalid.git
"""
)
assert result.stdout == expected_stdout
expected_stderr = """\
Error: Unable to access repo. Is the repo private? Try configuring Git to use SSH.
Expand Down