clonedEmptyRepository=warning: You appear to have cloned an empty repository.
cloningInto=Cloning into ''{0}''...
commitLabel=commit
+configOnlyListOptionSupported=only the --list option is currently supported
configFileNotFound=configuration file {0} not found
conflictingUsageOf_git_dir_andArguments=conflicting usage of --git-dir and arguments
couldNotCreateBranch=Could not create branch {0}: {1}
import java.util.Set;
import org.eclipse.jgit.errors.ConfigInvalidException;
-import org.eclipse.jgit.errors.NotSupportedException;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.StoredConfig;
+import org.eclipse.jgit.pgm.internal.CLIText;
import org.eclipse.jgit.storage.file.FileBasedConfig;
import org.eclipse.jgit.util.FS;
import org.eclipse.jgit.util.StringUtils;
/** {@inheritDoc} */
@Override
- protected void run() throws Exception {
- if (list)
+ protected void run() {
+ if (!list) {
+ throw die(CLIText.get().configOnlyListOptionSupported);
+ }
+ try {
list();
- else
- throw new NotSupportedException(
- "only --list option is currently supported"); //$NON-NLS-1$
+ } catch (IOException | ConfigInvalidException e) {
+ throw die(e.getMessage(), e);
+ }
}
private void list() throws IOException, ConfigInvalidException {
/***/ public String clonedEmptyRepository;
/***/ public String cloningInto;
/***/ public String commitLabel;
+ /***/ public String configOnlyListOptionSupported;
/***/ public String conflictingUsageOf_git_dir_andArguments;
/***/ public String couldNotCreateBranch;
/***/ public String dateInfo;