diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-11-28 11:42:20 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-11-28 12:01:04 +0100 |
commit | 122237439daee43956fe9f4255365afd40823e21 (patch) | |
tree | 3957a90678814937adaf7e3e60bdf0182dd978ed /org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java | |
parent | 6aa29d1166137372ae0948d180a9f88e9edd4b94 (diff) | |
download | jgit-122237439daee43956fe9f4255365afd40823e21.tar.gz jgit-122237439daee43956fe9f4255365afd40823e21.zip |
FS: debug logging only if system config file cannot be found
The command 'git config --system --show-origin --list -z' fails if
the system config doesn't exist. Use debug logging instead of a
warning for failures of that command. Typically the user cannot do
anything about it anyway, and JGit will just work without system
config.
Bug: 577492
Change-Id: If628ab376182183aea57a385c169e144d371bbb2
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java index 507bd2bc92..4482beb0f3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -1522,6 +1522,7 @@ public abstract class FS { String w; try { + // This command prints the path even if it doesn't exist w = readPipe(gitExe.getParentFile(), new String[] { gitExe.getPath(), "config", "--system", //$NON-NLS-1$ //$NON-NLS-2$ "--edit" }, //$NON-NLS-1$ @@ -1544,7 +1545,10 @@ public abstract class FS { "--show-origin", "--list", "-z" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ Charset.defaultCharset().name()); } catch (CommandFailedException e) { - LOG.warn(e.getMessage()); + // This command fails if the system config doesn't exist + if (LOG.isDebugEnabled()) { + LOG.debug(e.getMessage()); + } return null; } if (w == null) { |