During code review, Alex raised a few comments about commit
532421d98925 ("Refactor repository construction to builder class").
Due to the size of the related series we aren't going to go back
and rebase in something this minor, so resolve them as a follow-up
commit instead.
Change-Id: Ied52f7a8f7252743353c58d20bfc3ec498933e00
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
final TextBuiltin cmd = subcommand;
if (cmd.requiresRepository()) {
- RepositoryBuilder frb = new RepositoryBuilder() //
+ RepositoryBuilder rb = new RepositoryBuilder() //
.setGitDir(gitdir) //
.readEnvironment() //
.findGitDir();
- if (frb.getGitDir() == null) {
+ if (rb.getGitDir() == null) {
writer.println(CLIText.get().cantFindGitDirectory);
writer.flush();
System.exit(1);
}
- cmd.init(frb.build(), null);
+ cmd.init(rb.build(), null);
} else {
cmd.init(null, gitdir);
}
import java.io.IOException;
import java.io.PrintWriter;
+import org.eclipse.jgit.JGitText;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.Commit;
import org.eclipse.jgit.lib.Config;
fail("Must pass either GIT_DIR or GIT_WORK_TREE");
} catch (IllegalArgumentException e) {
assertEquals(
- "Either GIT_DIR or GIT_WORK_TREE must be passed to Repository constructor",
+ JGitText.get().eitherGitDirOrWorkTreeRequired,
e.getMessage());
}
}
duplicateRef=Duplicate ref: {0}
duplicateRemoteRefUpdateIsIllegal=Duplicate remote ref update is illegal. Affected remote name: {0}
duplicateStagesNotAllowed=Duplicate stages not allowed
-eitherGIT_DIRorGIT_WORK_TREEmustBePassed=Either GIT_DIR or GIT_WORK_TREE must be passed to Repository constructor
+eitherGitDirOrWorkTreeRequired=One of setGitDir or setWorkTree must be called.
emptyPathNotPermitted=Empty path not permitted.
encryptionError=Encryption error: {0}
endOfFileInEscape=End of file in escape
/***/ public String duplicateRef;
/***/ public String duplicateRemoteRefUpdateIsIllegal;
/***/ public String duplicateStagesNotAllowed;
- /***/ public String eitherGIT_DIRorGIT_WORK_TREEmustBePassed;
+ /***/ public String eitherGitDirOrWorkTreeRequired;
/***/ public String emptyPathNotPermitted;
/***/ public String encryptionError;
/***/ public String endOfFileInEscape;
protected void requireGitDirOrWorkTree() {
if (getGitDir() == null && getWorkTree() == null)
throw new IllegalArgumentException(
- JGitText.get().eitherGIT_DIRorGIT_WORK_TREEmustBePassed);
+ JGitText.get().eitherGitDirOrWorkTreeRequired);
}
/**