Browse Source

pgm: Fix too wide lines in Commit.run()

Change-Id: I695d1771b808217b0fbde29805e53a819d8c3303
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.4
Matthias Sohn 6 years ago
parent
commit
518f420fe6
  1. 2
      org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
  2. 7
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
  3. 2
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java

2
org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties

@ -175,7 +175,7 @@ notOnAnyBranch=Not currently on any branch.
onBranch=On branch {0} onBranch=On branch {0}
onBranchToBeBorn=You are on a branch yet to be born onBranchToBeBorn=You are on a branch yet to be born
onlyOneMetaVarExpectedIn=Only one {0} expected in {1}. onlyOneMetaVarExpectedIn=Only one {0} expected in {1}.
onlyOneOfIncludeOnlyAllInteractiveCanBeUsed=Only one of --include/--only/--all/--interactive can be used. onlyOneCommitOptionAllowed=Only one of --include/--only/--all/--interactive can be used.
password=Password: password=Password:
pathspecDidNotMatch=error: pathspec ''{0}'' did not match any file(s) known to git. pathspecDidNotMatch=error: pathspec ''{0}'' did not match any file(s) known to git.
pushTo=To {0} pushTo=To {0}

7
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java

@ -107,7 +107,7 @@ class Commit extends TextBuiltin {
throw die(CLIText.get().pathsRequired); throw die(CLIText.get().pathsRequired);
} }
if (only && all) { if (only && all) {
throw die(CLIText.get().onlyOneOfIncludeOnlyAllInteractiveCanBeUsed); throw die(CLIText.get().onlyOneCommitOptionAllowed);
} }
if (!paths.isEmpty()) { if (!paths.isEmpty()) {
for (String p : paths) { for (String p : paths) {
@ -133,10 +133,11 @@ class Commit extends TextBuiltin {
} else { } else {
branchName = head.getTarget().getName(); branchName = head.getTarget().getName();
if (branchName.startsWith(Constants.R_HEADS)) { if (branchName.startsWith(Constants.R_HEADS)) {
branchName = branchName.substring(Constants.R_HEADS.length()); branchName = branchName
.substring(Constants.R_HEADS.length());
} }
} }
outw.println("[" + branchName + " " + commit.name() + "] " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ outw.println('[' + branchName + ' ' + commit.name() + "] " //$NON-NLS-1$
+ commit.getShortMessage()); + commit.getShortMessage());
} catch (IOException e) { } catch (IOException e) {
throw die(e.getMessage(), e); throw die(e.getMessage(), e);

2
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java

@ -278,7 +278,7 @@ public class CLIText extends TranslationBundle {
/***/ public String onBranchToBeBorn; /***/ public String onBranchToBeBorn;
/***/ public String onBranch; /***/ public String onBranch;
/***/ public String onlyOneMetaVarExpectedIn; /***/ public String onlyOneMetaVarExpectedIn;
/***/ public String onlyOneOfIncludeOnlyAllInteractiveCanBeUsed; /***/ public String onlyOneCommitOptionAllowed;
/***/ public String password; /***/ public String password;
/***/ public String pathspecDidNotMatch; /***/ public String pathspecDidNotMatch;
/***/ public String pushTo; /***/ public String pushTo;

Loading…
Cancel
Save