From 28553c189c0561b41d31567256cb320c05075d47 Mon Sep 17 00:00:00 2001 From: Adrien Bustany Date: Thu, 22 Aug 2019 17:11:45 +0200 Subject: [PATCH] Fix copy-paste typo in CloneCommand#cleanup deleteChildren was called on directory instead of gitDir, leading to a potential null pointer exception if the git directory existed initially. Bug: 550340 Change-Id: Iafc3b2961253a99862a59e81c7371f7bc564b412 Signed-off-by: Adrien Bustany --- org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java index 5c06bac1f..eee3da6f6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java @@ -700,7 +700,7 @@ private void cleanup() { FileUtils.delete(gitDir, FileUtils.RECURSIVE | FileUtils.SKIP_MISSING | FileUtils.IGNORE_ERRORS); } else { - deleteChildren(directory); + deleteChildren(gitDir); } } } catch (IOException e) {