Skip to content
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

Fix JENKINS-30371 allow symlinks with jgit #193

Merged

Conversation

MarkEWaite
Copy link
Contributor

Including one more JGit jar from the JGit 3.7.1 package allows JGit to support symbolic links in some cases.

Users running Java 6 will not have symlink support because the JGit library won't be loaded.

Users running Windows with default settings will not have symlink support because Windows does not allow symbolic links by default.

Users running Linux or FreeBSD or HP-UX or AIX or other Unix-like environments should have symbolic link support so long as they are running Java 7 or newer.

JGit symlink support is optional with JGit 3.7.1.  It requires a copy of
the JGit java7 jar, a Java 7 VM, and a file system which supports symbolic
links.  Including the jar file in a Java 6 environment is safe because
the JGit code won't load the additional jar when running on Java 6.
Latest findbugs requires Java 7, but the git client plugin needs to
allow testing with Java 6 so that Java 6 users are not broken by changes.
MarkEWaite added a commit that referenced this pull request Nov 23, 2015
@MarkEWaite MarkEWaite merged commit d489829 into jenkinsci:master Nov 23, 2015
@MarkEWaite MarkEWaite deleted the master-JENKINS-30371-jgit-symlinks branch November 23, 2015 16:38
@@ -2044,13 +2044,20 @@ public void test_hasSubmodules() throws Exception {
assertFalse(w.git.hasGitModules());
}

private boolean isJava6() {
if (System.getProperty("java.version").startsWith("1.6")) {
Copy link
Member

Choose a reason for hiding this comment

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

1.66 == 1.6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, as is 1.6.0_0 and 1.6.0_14 and 1.6.0_11 and 1.6.0_15 and 1.6.0_05 and 1.6.0_45. The question is trying to answer "is this Java 6 (and not Java 7 or Java 8)", not "is this a specific version of Java 6".

Do you see a problem with that technique?

Is there a better technique for deciding that the currently executing Java runtime environment does not have support for symbolic links?

Copy link
Member

Choose a reason for hiding this comment

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

startsWith("1.6.") looks better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants