Skip to content

Commit

Permalink
CWE-153949
Browse files Browse the repository at this point in the history
Deleting files from a git repository and syncing the changes to ISPW
does not remove the component in ISPW
https://agile.compuware.com/browse/CWE-153949
  • Loading branch information
katieeluskie committed Dec 10, 2019
1 parent b9ad793 commit 19fed46
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/com/compuware/ispw/git/GitToIspwPublishStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.scm.ChangeLogSet;
import hudson.scm.EditType;
import hudson.scm.ChangeLogSet.AffectedFile;
import hudson.scm.ChangeLogSet.Entry;
import hudson.util.ListBoxModel;
import jenkins.model.Jenkins;
Expand Down Expand Up @@ -109,11 +111,14 @@ protected Integer run() throws Exception
{
Entry changeLogSet = itrChangeSet.next();
logger.println("Commit ID = " + changeLogSet.getCommitId());
Collection<String> affectedPaths = changeLogSet.getAffectedPaths();

for (Iterator<String> iterator = affectedPaths.iterator(); iterator.hasNext();)
Collection<? extends AffectedFile> affectedFiles = changeLogSet.getAffectedFiles();
for (AffectedFile affectedFile : affectedFiles)
{
String affectedPath = iterator.next();
String affectedPath = affectedFile.getPath();
if (affectedFile.getEditType() == EditType.DELETE)
{
affectedPath = "|" + changeLogSet.getCommitId() + "|" + affectedPath;
}
changedPathSet.add(affectedPath);
}
}
Expand Down

0 comments on commit 19fed46

Please sign in to comment.