Browse Source

CleanCommand: don't fire WorkingTreeModifiedEvent on dry run

Since no files are actually deleted it makes no sense to fire such an
event.

Change-Id: I66e87afc1791f27fddaa873bafe8bb8b61662535
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
stable-5.1
Thomas Wolf 6 years ago
parent
commit
f508a00176
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java

2
org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java

@ -136,7 +136,7 @@ public class CleanCommand extends GitCommand<Set<String>> {
} catch (IOException e) {
throw new JGitInternalException(e.getMessage(), e);
} finally {
if (!files.isEmpty()) {
if (!dryRun && !files.isEmpty()) {
repo.fireEvent(new WorkingTreeModifiedEvent(null, files));
}
}

Loading…
Cancel
Save