Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Log an error message when Git repositories are checked out with shallow clone #1265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Log an error message when Git repositories are checked out with shallow clone #1265
Changes from all commits
6a03773790f51dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Check warning on line 29 in plugin/src/main/java/io/jenkins/plugins/forensics/git/blame/GitBlamerFactory.java
CPD
Raw output
<pre><code>public Optional<Blamer> createBlamer(final SCM scm, final Run<?, ?> build, final FilePath workTree, final TaskListener listener, final FilteredLog logger) { var validator = new GitRepositoryValidator(scm, build, workTree, listener, logger); if (validator.isFullGitRepository()) {<!-- --></code></pre>Check warning on line 28 in plugin/src/main/java/io/jenkins/plugins/forensics/git/miner/GitMinerFactory.java
CPD
Raw output
<pre><code>public Optional<Blamer> createBlamer(final SCM scm, final Run<?, ?> build, final FilePath workTree, final TaskListener listener, final FilteredLog logger) { var validator = new GitRepositoryValidator(scm, build, workTree, listener, logger); if (validator.isFullGitRepository()) {<!-- --></code></pre>Check warning on line 57 in plugin/src/test/java/io/jenkins/plugins/forensics/git/util/GitRepositoryValidatorTest.java
CPD
Raw output
<pre><code>void isGitRepositoryShouldReturnTrueForNonShallowGit() throws IOException, InterruptedException { GitSCM gitSCM = createNonShallowGitScm(); Run<?, ?> run = mock(Run.class); var envVars = new EnvVars(); when(run.getEnvironment(NULL_LISTENER)).thenReturn(envVars); var workspace = createWorkTree(); GitClient gitClient = mock(GitClient.class); when(gitSCM.createClient(NULL_LISTENER, envVars, run, workspace)).thenReturn(gitClient); when(gitClient.revParse(anyString())).thenReturn(mock(ObjectId.class)); var logger = createLogger(); var validator = new GitRepositoryValidator(gitSCM, run, workspace, NULL_LISTENER, logger); assertThat(validator.isGitRepository()).isTrue();</code></pre>Check warning on line 58 in plugin/src/test/java/io/jenkins/plugins/forensics/git/util/GitRepositoryValidatorTest.java
CPD
Raw output
Check warning on line 76 in plugin/src/test/java/io/jenkins/plugins/forensics/git/util/GitRepositoryValidatorTest.java
CPD
Raw output
Check warning on line 77 in plugin/src/test/java/io/jenkins/plugins/forensics/git/util/GitRepositoryValidatorTest.java
CPD
Raw output
Check warning on line 104 in plugin/src/test/java/io/jenkins/plugins/forensics/git/util/GitRepositoryValidatorTest.java
CPD
Raw output
<pre><code>void isGitRepositoryShouldReturnTrueForNonShallowGit() throws IOException, InterruptedException { GitSCM gitSCM = createNonShallowGitScm(); Run<?, ?> run = mock(Run.class); var envVars = new EnvVars(); when(run.getEnvironment(NULL_LISTENER)).thenReturn(envVars); var workspace = createWorkTree(); GitClient gitClient = mock(GitClient.class); when(gitSCM.createClient(NULL_LISTENER, envVars, run, workspace)).thenReturn(gitClient); when(gitClient.revParse(anyString())).thenReturn(mock(ObjectId.class)); var logger = createLogger(); var validator = new GitRepositoryValidator(gitSCM, run, workspace, NULL_LISTENER, logger); assertThat(validator.isGitRepository()).isTrue();</code></pre>Check warning on line 104 in plugin/src/test/java/io/jenkins/plugins/forensics/git/util/GitRepositoryValidatorTest.java
CPD
Raw output
Uh oh!
There was an error while loading. Please reload this page.