diff options
author | Kevin Sawicki <kevin@github.com> | 2012-02-29 10:16:56 -0800 |
---|---|---|
committer | Chris Aniszczyk <zx@twitter.com> | 2012-03-05 20:59:44 -0800 |
commit | 9e4b4fc41c4220779a96afeca17c669f36945721 (patch) | |
tree | 1a602e3e3588dcb52b66c661187d47696b668557 /org.eclipse.jgit | |
parent | 8db5414dcf09e62154818b4d8da7d5be07098bb2 (diff) | |
download | jgit-9e4b4fc41c4220779a96afeca17c669f36945721.tar.gz jgit-9e4b4fc41c4220779a96afeca17c669f36945721.zip |
Set person and message on stash ref update
This will be the message and person used for the commit
of stashed working directory changes.
Bug: 372884
Change-Id: I2501b080f6b94e826cf7dba3fd526ae5c1d969d1
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java index e26ae879fd..d5fffb9cd2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java @@ -180,10 +180,13 @@ public class StashCreateCommand extends GitCommand<RevCommit> { return builder; } - private void updateStashRef(ObjectId commitId) throws IOException { + private void updateStashRef(ObjectId commitId, PersonIdent refLogIdent, + String refLogMessage) throws IOException { Ref currentRef = repo.getRef(ref); RefUpdate refUpdate = repo.updateRef(ref); refUpdate.setNewObjectId(commitId); + refUpdate.setRefLogIdent(refLogIdent); + refUpdate.setRefLogMessage(refLogMessage, false); if (currentRef != null) refUpdate.setExpectedOldObjectId(currentRef.getObjectId()); else @@ -300,7 +303,8 @@ public class StashCreateCommand extends GitCommand<RevCommit> { commitId = inserter.insert(builder); inserter.flush(); - updateStashRef(commitId); + updateStashRef(commitId, builder.getAuthor(), + builder.getMessage()); } finally { inserter.release(); cache.unlock(); |