diff options
| author | Kevin Sawicki | 2011-04-15 00:13:21 +0000 |
|---|---|---|
| committer | Chris Aniszczyk | 2011-04-15 15:09:33 +0000 |
| commit | 8ed530d0cf51ce71b120de3ac1c9ec3d2c4769c2 (patch) | |
| tree | 3e084ef18a818c4162b2ad5d3ecb18efb4790f54 | |
| parent | 0dccbf11c3f681f0558c8b8f197462bf5d94101c (diff) | |
| download | egit-github-8ed530d0cf51ce71b120de3ac1c9ec3d2c4769c2.tar.gz egit-github-8ed530d0cf51ce71b120de3ac1c9ec3d2c4769c2.tar.xz egit-github-8ed530d0cf51ce71b120de3ac1c9ec3d2c4769c2.zip | |
Use attachment file from attribute instead of source
This now correctly uploads the attachment as the filename
entered in the task attachment wizard.
Change-Id: Ib44706d9a6520ae54d954a8cab38152afacdd9fa
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
| -rw-r--r-- | org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java index 40b11168..03bc94c1 100644 --- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java @@ -28,6 +28,7 @@ import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentHandler; import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource; +import org.eclipse.mylyn.tasks.core.data.TaskAttachmentMapper; import org.eclipse.mylyn.tasks.core.data.TaskAttribute; /** @@ -87,11 +88,13 @@ public class GistAttachmentHandler extends AbstractTaskAttachmentHandler { AbstractTaskAttachmentSource source, String comment, TaskAttribute attachmentAttribute, IProgressMonitor monitor) throws CoreException { + TaskAttachmentMapper mapper = TaskAttachmentMapper + .createFrom(attachmentAttribute); Gist gist = new Gist().setRepo(task.getTaskId()); gist.setDescription(attachmentAttribute.getParentAttribute() .getAttribute(GistAttribute.DESCRIPTION.getId()).getValue()); GistFile file = new GistFile(); - file.setFilename(source.getName()); + file.setFilename(mapper.getFileName()); gist.setFiles(Collections.singletonMap(file.getFilename(), file)); GitHubClient client = new GitHubClient(); |
