Skip to content

Commit 275ce17

Browse files
committed
Only configure the gpgsigning if the repository exists
Some test configurations in my lab environment fail merge tests because the repository does not yet exist when the decorator is run.
1 parent 1ca8838 commit 275ce17

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/test/java/hudson/plugins/git/GitSCMSlowTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,11 @@ public TestPreBuildMerge(UserMergeOptions options) {
334334
@Override
335335
public GitClient decorate(GitSCM scm, GitClient git) throws IOException, InterruptedException, GitException {
336336
GitClient gitClient = super.decorate(scm, git);
337-
gitClient.config(GitClient.ConfigLevel.LOCAL, "commit.gpgsign", "false");
338-
gitClient.config(GitClient.ConfigLevel.LOCAL, "tag.gpgSign", "false");
337+
if (gitClient.hasGitRepo()) {
338+
// Do not attempt to disable GPG signing unless we're in a repository
339+
gitClient.config(GitClient.ConfigLevel.LOCAL, "commit.gpgsign", "false");
340+
gitClient.config(GitClient.ConfigLevel.LOCAL, "tag.gpgSign", "false");
341+
}
339342
return gitClient;
340343
}
341344
}

0 commit comments

Comments
 (0)