Browse Source

diff: add option metaVar for --src-prefix and --dst-prefix

Fixes exception if using "jgit diff --help".

Bug: 544735
Change-Id: I694ff3103da4bc199dd03c40962c5be191eddcd1
Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
stable-5.4
Andre Bossert 6 years ago
parent
commit
963651b762
  1. 1
      org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
  2. 4
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java

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

@ -133,6 +133,7 @@ metaVar_path=path
metaVar_paths=path ... metaVar_paths=path ...
metaVar_pattern=pattern metaVar_pattern=pattern
metaVar_port=PORT metaVar_port=PORT
metaVar_prefix=PREFIX
metaVar_ref=REF metaVar_ref=REF
metaVar_refs=REFS metaVar_refs=REFS
metaVar_refspec=refspec metaVar_refspec=refspec

4
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java

@ -151,12 +151,12 @@ class Diff extends TextBuiltin {
diffFmt.setAbbreviationLength(OBJECT_ID_STRING_LENGTH); diffFmt.setAbbreviationLength(OBJECT_ID_STRING_LENGTH);
} }
@Option(name = "--src-prefix", usage = "usage_srcPrefix") @Option(name = "--src-prefix", metaVar = "metaVar_prefix", usage = "usage_srcPrefix")
void sourcePrefix(String path) { void sourcePrefix(String path) {
diffFmt.setOldPrefix(path); diffFmt.setOldPrefix(path);
} }
@Option(name = "--dst-prefix", usage = "usage_dstPrefix") @Option(name = "--dst-prefix", metaVar = "metaVar_prefix", usage = "usage_dstPrefix")
void dstPrefix(String path) { void dstPrefix(String path) {
diffFmt.setNewPrefix(path); diffFmt.setNewPrefix(path);
} }

Loading…
Cancel
Save