From 4dba37ad73afdb63b5fc9e7c7e0feaf633d06411 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Mon, 27 Jan 2014 15:32:25 +0400 Subject: [PATCH] IDEA-119855 Github: remove duplicates from "Share On Github" dialog ChangeListManager can return outdated list of affected files. untracked files from UntrackedFilesHolder are always up to date. This can lead to file duplication on running action after deleting git repo (all old affected files become untracked, but data is not refreshed yet). --- .../src/org/jetbrains/plugins/github/GithubShareAction.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java index 5d2a4dc79f83..28689714ea04 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java @@ -288,6 +288,8 @@ public class GithubShareAction extends DumbAwareAction { final List trackedFiles = ChangeListManager.getInstance(project).getAffectedFiles(); final Collection untrackedFiles = filterOutIgnored(project, repository.getUntrackedFilesHolder().retrieveUntrackedFiles()); + trackedFiles.removeAll(untrackedFiles); // fix IDEA-119855 + final List allFiles = new ArrayList(); allFiles.addAll(trackedFiles); allFiles.addAll(untrackedFiles);