Will Saxon edited a comment on Bug JENKINS-21114

I also found that when using msysgit on windows, it expects the objects/info/alternates file to have unix line endings. So even if the path is correct, it fetches the packs anyway.

Here is a patch against 1.6.0 which fixes both problems on my system (not sure if it works elsewhere):


diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java b/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
index cd6b092..2de9f66 100644
--- a/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
+++ b/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
@@ -335,7 +335,8 @@ public class CliGitAPIImpl extends LegacyCompatibleGitAPIImpl {
                         try {
                             File alternates = new File(workspace, ".git/objects/info/alternates");
                             PrintWriter w = new PrintWriter(alternates);
-                            w.println(new File(referencePath, ".git/objects").getAbsolutePath());
+                            w.print(new File(referencePath, reference.endsWith(".git") ? "/objects" : ".git/objects").getAbsolutePath());
+                            w.print("\n");
                             w.close();
                         } catch (FileNotFoundException e) {
                             listener.error("Failed to setup reference");

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to