diff options
author | Tomasz Zarna <tomasz.zarna@tasktop.com> | 2012-11-04 21:57:12 +0100 |
---|---|---|
committer | Chris Aniszczyk <zx@twitter.com> | 2012-11-15 16:05:09 -0800 |
commit | 790126c1457fba6c85680dc7858b4c84e84ea640 (patch) | |
tree | 709fce6cf789c6c5b30386e735100c58e7e9ec44 /org.eclipse.jgit.pgm/src | |
parent | 074f9194dc5c4ad4987f7ec6f956c7da7d80702c (diff) | |
download | jgit-790126c1457fba6c85680dc7858b4c84e84ea640.tar.gz jgit-790126c1457fba6c85680dc7858b4c84e84ea640.zip |
Do not fail when checking out HEAD
Change-Id: I99f5467477ed53101121a5a5d8a0910c55758401
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java index c356e184a4..953a5e02d5 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java @@ -83,6 +83,8 @@ class Checkout extends TextBuiltin { try { String oldBranch = db.getBranch(); Ref ref = command.call(); + if (ref == null) + return; if (Repository.shortenRefName(ref.getName()).equals(oldBranch)) { outw.println(MessageFormat.format( CLIText.get().alreadyOnBranch, |