aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-14 20:13:21 (EDT)
committerChris Aniszczyk2011-04-15 11:09:33 (EDT)
commit8ed530d0cf51ce71b120de3ac1c9ec3d2c4769c2 (patch)
tree3e084ef18a818c4162b2ad5d3ecb18efb4790f54
parent0dccbf11c3f681f0558c8b8f197462bf5d94101c (diff)
downloadegit-github-8ed530d0cf51ce71b120de3ac1c9ec3d2c4769c2.zip
egit-github-8ed530d0cf51ce71b120de3ac1c9ec3d2c4769c2.tar.gz
egit-github-8ed530d0cf51ce71b120de3ac1c9ec3d2c4769c2.tar.bz2
Use attachment file from attribute instead of sourcerefs/changes/32/3132/2
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.java5
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 40b1116..03bc94c 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();