camel-git - Add depth option to provide shallow clone#21581
camel-git - Add depth option to provide shallow clone#21581Croway merged 1 commit intoapache:mainfrom
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
| case BRANCH -> new GitBranchConsumer(this, processor); | ||
| }; |
There was a problem hiding this comment.
Is the behavior change done on purpose in case the type is not part of the list?
There was a problem hiding this comment.
I did a small refactor, and since GitType is an enum, the default is unnecessary, the default branch is dead code
| } | ||
| var cloneCommand = Git.cloneRepository() | ||
| .setURI(endpoint.getRemotePath()) | ||
| .setDirectory(new File(endpoint.getLocalPath())); |
There was a problem hiding this comment.
Why not reusing directly localRepo variable?
| .to("git:///tmp/myRepo?operation=clone&remotePath=https://github.com/example/repo.git&depth=1"); | ||
| --------------------------------------- | ||
|
|
||
| A `depth` of 1 fetches only the latest commit. When set to 0 or omitted, a full clone is performed. |
There was a problem hiding this comment.
based on implementation, it is when set to 0 or less than 0 or omitted
There was a problem hiding this comment.
when depth is omitted, private int depth; defaults to 0, therefore, it should be correct, am I missing something?
There was a problem hiding this comment.
if depth is set to a negative number, it is doing a full clone
No description provided.