diff options
author | Dariusz Luksza <dariusz@luksza.org> | 2012-05-23 02:04:04 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2012-05-23 16:18:33 +0200 |
commit | 1bec1f2fae58649bf1d29d5d9e226545fa66f170 (patch) | |
tree | 7b28428244d60cadc7d1fd2308a1ae3cc63b421b /org.eclipse.jgit/src/org/eclipse/jgit | |
parent | 3da4c6fc58b666d31eafaaec3f1337fc665cd14f (diff) | |
download | jgit-1bec1f2fae58649bf1d29d5d9e226545fa66f170.tar.gz jgit-1bec1f2fae58649bf1d29d5d9e226545fa66f170.zip |
Ensure resetting on commit id
When reset command was called with tag name as parameter the resulting
HEAD was set to the tag's SHA-1 which is a bug. This patch ensures that
repository.resolve() call always returns commit id.
Change-Id: I219b898c620a75c497c8652dbf4735fd094c4d7c
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java index 60776f903c..422056bd6d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java @@ -150,7 +150,7 @@ public class ResetCommand extends GitCommand<Ref> { // resolve the ref to a commit final ObjectId commitId; try { - commitId = repo.resolve(ref); + commitId = repo.resolve(ref + "^{commit}"); if (commitId == null) { // @TODO throw an InvalidRefNameException. We can't do that // now because this would break the API |