From 790126c1457fba6c85680dc7858b4c84e84ea640 Mon Sep 17 00:00:00 2001 From: Tomasz Zarna Date: Sun, 4 Nov 2012 21:57:12 +0100 Subject: Do not fail when checking out HEAD Change-Id: I99f5467477ed53101121a5a5d8a0910c55758401 Signed-off-by: Chris Aniszczyk --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'org.eclipse.jgit.pgm') 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, -- cgit v1.2.3