Package org.eclipse.jgit.pgm

Examples of org.eclipse.jgit.pgm.Die


        return new CassandraRepositoryBuilder() //
            .setDatabase(connect(gitdir)) //
            .setURI(gitdir) //
            .build();
      } catch (URISyntaxException e) {
        throw new Die("Invalid URI " + gitdir);
      }
    }
    return super.openGitDir(gitdir);
  }
View Full Code Here


            clp.parseArgument(argv);
        } catch (CmdLineException e) {
            if (argv.length > 0 && !help) {
                writer.println(MessageFormat.format(CLIText.get().fatalError, e.getMessage()));
                writer.flush();
                throw new Die(true);
            }
        }

        if (argv.length == 0 || help) {
            final String ex = clp.printExample(ExampleMode.ALL, CLIText.get().resourceBundle());
            writer.println("jgit" + ex + " command [ARG ...]"); //$NON-NLS-1$
            if (help) {
                writer.println();
                clp.printUsage(writer, CLIText.get().resourceBundle());
                writer.println();
            } else if (subcommand == null) {
                writer.println();
                writer.println(CLIText.get().mostCommonlyUsedCommandsAre);
                final CommandRef[] common = CommandCatalog.common();
                int width = 0;
                for (final CommandRef c : common)
                    width = Math.max(width, c.getName().length());
                width += 2;

                for (final CommandRef c : common) {
                    writer.print(' ');
                    writer.print(c.getName());
                    for (int i = c.getName().length(); i < width; i++)
                        writer.print(' ');
                    writer.print(CLIText.get().resourceBundle().getString(c.getUsage()));
                    writer.println();
                }
                writer.println();
            }
            writer.flush();
            throw new Die(true);
        }

        gitdir = new File(rootDir, gitdir).getPath();

        final TextBuiltin cmd = subcommand;
View Full Code Here

   }

   private void doCheckout(final Ref branch) throws IOException
   {
      if (branch == null)
         throw new Die(CLIText.get().cannotChekoutNoHeadsAdvertisedByRemote);
      if (!Constants.HEAD.equals(branch.getName()))
      {
         RefUpdate u = db.updateRef(Constants.HEAD);
         u.disableRefLog();
         u.link(branch.getName());
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.pgm.Die

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.