Browse Source

Warn if configured cookie file is missing

We logged a stack trace if the configured http.cookieFile was missing.
Instead only log a warning.

Bug: 548081
Change-Id: I42e39f5ad8ffce7b43162e5068f60af073b8a126
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.5
Matthias Sohn 6 years ago
parent
commit
786380bd5e
  1. 1
      org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
  2. 1
      org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
  3. 5
      org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/http/NetscapeCookieFile.java

1
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties

@ -459,6 +459,7 @@ mismatchOffset=mismatch offset for object {0}
mismatchCRC=mismatch CRC for object {0} mismatchCRC=mismatch CRC for object {0}
missingAccesskey=Missing accesskey. missingAccesskey=Missing accesskey.
missingConfigurationForKey=No value for key {0} found in configuration missingConfigurationForKey=No value for key {0} found in configuration
missingCookieFile=Configured http.cookieFile ''{0}'' is missing
missingCRC=missing CRC for object {0} missingCRC=missing CRC for object {0}
missingDeltaBase=delta base missingDeltaBase=delta base
missingForwardImageInGITBinaryPatch=Missing forward-image in GIT binary patch missingForwardImageInGITBinaryPatch=Missing forward-image in GIT binary patch

1
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java

@ -520,6 +520,7 @@ public class JGitText extends TranslationBundle {
/***/ public String mismatchCRC; /***/ public String mismatchCRC;
/***/ public String missingAccesskey; /***/ public String missingAccesskey;
/***/ public String missingConfigurationForKey; /***/ public String missingConfigurationForKey;
/***/ public String missingCookieFile;
/***/ public String missingCRC; /***/ public String missingCRC;
/***/ public String missingDeltaBase; /***/ public String missingDeltaBase;
/***/ public String missingForwardImageInGITBinaryPatch; /***/ public String missingForwardImageInGITBinaryPatch;

5
org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/http/NetscapeCookieFile.java

@ -344,6 +344,11 @@ public final class NetscapeCookieFile {
final int maxStaleRetries = 5; final int maxStaleRetries = 5;
int retries = 0; int retries = 0;
File file = getPath().toFile(); File file = getPath().toFile();
if (!file.exists()) {
LOG.warn(MessageFormat.format(JGitText.get().missingCookieFile,
file.getAbsolutePath()));
return new byte[0];
}
while (true) { while (true) {
final FileSnapshot oldSnapshot = snapshot; final FileSnapshot oldSnapshot = snapshot;
final FileSnapshot newSnapshot = FileSnapshot.save(file); final FileSnapshot newSnapshot = FileSnapshot.save(file);

Loading…
Cancel
Save