Merge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47e
* changes: cleanup: Silence an unused-parameter warning cleanup: Get rid of some unused-warnings cleanup: Remove unused parameter in ConsoleCredentialsProvider cleanup: Drop unused parameter on DhtPackParser cleanup: Remove unneeded parameter to private method in RefUpdateTest cleanup: Remove unnecessary @SuppressWarnings
This commit is contained in:
commit
0a69f05647
|
@ -99,16 +99,16 @@ public boolean get(URIish uri, CredentialItem... items)
|
||||||
CredentialItem item = items[i];
|
CredentialItem item = items[i];
|
||||||
|
|
||||||
if (item instanceof CredentialItem.StringType)
|
if (item instanceof CredentialItem.StringType)
|
||||||
ok = get(uri, (CredentialItem.StringType) item);
|
ok = get((CredentialItem.StringType) item);
|
||||||
|
|
||||||
else if (item instanceof CredentialItem.CharArrayType)
|
else if (item instanceof CredentialItem.CharArrayType)
|
||||||
ok = get(uri, (CredentialItem.CharArrayType) item);
|
ok = get((CredentialItem.CharArrayType) item);
|
||||||
|
|
||||||
else if (item instanceof CredentialItem.YesNoType)
|
else if (item instanceof CredentialItem.YesNoType)
|
||||||
ok = get(uri, (CredentialItem.YesNoType) item);
|
ok = get((CredentialItem.YesNoType) item);
|
||||||
|
|
||||||
else if (item instanceof CredentialItem.InformationalMessage)
|
else if (item instanceof CredentialItem.InformationalMessage)
|
||||||
ok = get(uri, (CredentialItem.InformationalMessage) item);
|
ok = get((CredentialItem.InformationalMessage) item);
|
||||||
|
|
||||||
else
|
else
|
||||||
throw new UnsupportedCredentialItem(uri, item.getPromptText());
|
throw new UnsupportedCredentialItem(uri, item.getPromptText());
|
||||||
|
@ -116,7 +116,7 @@ else if (item instanceof CredentialItem.InformationalMessage)
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean get(URIish uri, CredentialItem.StringType item) {
|
private boolean get(CredentialItem.StringType item) {
|
||||||
if (item.isValueSecure()) {
|
if (item.isValueSecure()) {
|
||||||
char[] v = cons.readPassword("%s: ", item.getPromptText());
|
char[] v = cons.readPassword("%s: ", item.getPromptText());
|
||||||
if (v != null) {
|
if (v != null) {
|
||||||
|
@ -136,7 +136,7 @@ private boolean get(URIish uri, CredentialItem.StringType item) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean get(URIish uri, CredentialItem.CharArrayType item) {
|
private boolean get(CredentialItem.CharArrayType item) {
|
||||||
if (item.isValueSecure()) {
|
if (item.isValueSecure()) {
|
||||||
char[] v = cons.readPassword("%s: ", item.getPromptText());
|
char[] v = cons.readPassword("%s: ", item.getPromptText());
|
||||||
if (v != null) {
|
if (v != null) {
|
||||||
|
@ -156,13 +156,13 @@ private boolean get(URIish uri, CredentialItem.CharArrayType item) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean get(URIish uri, CredentialItem.InformationalMessage item) {
|
private boolean get(CredentialItem.InformationalMessage item) {
|
||||||
cons.printf("%s\n", item.getPromptText());
|
cons.printf("%s\n", item.getPromptText());
|
||||||
cons.flush();
|
cons.flush();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean get(URIish uri, CredentialItem.YesNoType item) {
|
private boolean get(CredentialItem.YesNoType item) {
|
||||||
String r = cons.readLine("%s [%s/%s]? ", item.getPromptText(),
|
String r = cons.readLine("%s [%s/%s]? ", item.getPromptText(),
|
||||||
ConsoleText.get().answerYes, ConsoleText.get().answerNo);
|
ConsoleText.get().answerYes, ConsoleText.get().answerNo);
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
|
|
|
@ -138,7 +138,6 @@ public void setAsIsFileService(AsIsFileService f) {
|
||||||
* the factory to construct and configure an {@link UploadPack}
|
* the factory to construct and configure an {@link UploadPack}
|
||||||
* session when a fetch or clone is requested by a client.
|
* session when a fetch or clone is requested by a client.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void setUploadPackFactory(UploadPackFactory<HttpServletRequest> f) {
|
public void setUploadPackFactory(UploadPackFactory<HttpServletRequest> f) {
|
||||||
gitFilter.setUploadPackFactory(f);
|
gitFilter.setUploadPackFactory(f);
|
||||||
}
|
}
|
||||||
|
@ -158,7 +157,6 @@ public void addUploadPackFilter(Filter filter) {
|
||||||
* the factory to construct and configure a {@link ReceivePack}
|
* the factory to construct and configure a {@link ReceivePack}
|
||||||
* session when a push is requested by a client.
|
* session when a push is requested by a client.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void setReceivePackFactory(ReceivePackFactory<HttpServletRequest> f) {
|
public void setReceivePackFactory(ReceivePackFactory<HttpServletRequest> f) {
|
||||||
gitFilter.setReceivePackFactory(f);
|
gitFilter.setReceivePackFactory(f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,6 +184,7 @@ public void debug(Throwable thrown) {
|
||||||
// Ignore (not relevant to test failures)
|
// Ignore (not relevant to test failures)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public void ignore(Throwable arg0) {
|
public void ignore(Throwable arg0) {
|
||||||
// Ignore (not relevant to test failures)
|
// Ignore (not relevant to test failures)
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Fetch extends AbstractFetchCommand {
|
||||||
private Boolean fsck;
|
private Boolean fsck;
|
||||||
|
|
||||||
@Option(name = "--no-fsck")
|
@Option(name = "--no-fsck")
|
||||||
void nofsck(final boolean ignored) {
|
void nofsck(@SuppressWarnings("unused") final boolean ignored) {
|
||||||
fsck = Boolean.FALSE;
|
fsck = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ void nofsck(final boolean ignored) {
|
||||||
private Boolean thin;
|
private Boolean thin;
|
||||||
|
|
||||||
@Option(name = "--no-thin")
|
@Option(name = "--no-thin")
|
||||||
void nothin(final boolean ignored) {
|
void nothin(@SuppressWarnings("unused") final boolean ignored) {
|
||||||
thin = Boolean.FALSE;
|
thin = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ class Push extends TextBuiltin {
|
||||||
private boolean thin = Transport.DEFAULT_PUSH_THIN;
|
private boolean thin = Transport.DEFAULT_PUSH_THIN;
|
||||||
|
|
||||||
@Option(name = "--no-thin")
|
@Option(name = "--no-thin")
|
||||||
void nothin(final boolean ignored) {
|
void nothin(@SuppressWarnings("unused") final boolean ignored) {
|
||||||
thin = false;
|
thin = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1016,11 +1016,11 @@ protected void onInflatedObjectData(PackedObjectInfo obj, int typeCode,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OBJ_TREE:
|
case OBJ_TREE:
|
||||||
onTree(info, data);
|
onTree(data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OBJ_TAG:
|
case OBJ_TAG:
|
||||||
onTag(info, data);
|
onTag(data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1045,7 +1045,7 @@ private void onCommit(DhtInfo obj, byte[] raw) throws DhtException {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onTree(DhtInfo obj, byte[] data) {
|
private void onTree(byte[] data) {
|
||||||
if (isSaveAsCachedPack()) {
|
if (isSaveAsCachedPack()) {
|
||||||
treeParser.reset(data);
|
treeParser.reset(data);
|
||||||
while (!treeParser.eof()) {
|
while (!treeParser.eof()) {
|
||||||
|
@ -1056,7 +1056,7 @@ private void onTree(DhtInfo obj, byte[] data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onTag(DhtInfo obj, byte[] data) {
|
private void onTag(byte[] data) {
|
||||||
if (isSaveAsCachedPack()) {
|
if (isSaveAsCachedPack()) {
|
||||||
idBuffer.fromString(data, 7); // "object $sha1"
|
idBuffer.fromString(data, 7); // "object $sha1"
|
||||||
lookupByName(idBuffer).setReferenced();
|
lookupByName(idBuffer).setReferenced();
|
||||||
|
|
|
@ -616,7 +616,7 @@ public void testRenameBranchHasPreviousLog() throws IOException {
|
||||||
ObjectId oldHead = db.resolve(Constants.HEAD);
|
ObjectId oldHead = db.resolve(Constants.HEAD);
|
||||||
assertFalse("precondition for this test, branch b != HEAD", rb
|
assertFalse("precondition for this test, branch b != HEAD", rb
|
||||||
.equals(oldHead));
|
.equals(oldHead));
|
||||||
writeReflog(db, rb, rb, "Just a message", "refs/heads/b");
|
writeReflog(db, rb, "Just a message", "refs/heads/b");
|
||||||
assertTrue("log on old branch", new File(db.getDirectory(),
|
assertTrue("log on old branch", new File(db.getDirectory(),
|
||||||
"logs/refs/heads/b").exists());
|
"logs/refs/heads/b").exists());
|
||||||
RefRename renameRef = db.renameRef("refs/heads/b",
|
RefRename renameRef = db.renameRef("refs/heads/b",
|
||||||
|
@ -640,7 +640,7 @@ public void testRenameCurrentBranch() throws IOException {
|
||||||
writeSymref(Constants.HEAD, "refs/heads/b");
|
writeSymref(Constants.HEAD, "refs/heads/b");
|
||||||
ObjectId oldHead = db.resolve(Constants.HEAD);
|
ObjectId oldHead = db.resolve(Constants.HEAD);
|
||||||
assertTrue("internal test condition, b == HEAD", rb.equals(oldHead));
|
assertTrue("internal test condition, b == HEAD", rb.equals(oldHead));
|
||||||
writeReflog(db, rb, rb, "Just a message", "refs/heads/b");
|
writeReflog(db, rb, "Just a message", "refs/heads/b");
|
||||||
assertTrue("log on old branch", new File(db.getDirectory(),
|
assertTrue("log on old branch", new File(db.getDirectory(),
|
||||||
"logs/refs/heads/b").exists());
|
"logs/refs/heads/b").exists());
|
||||||
RefRename renameRef = db.renameRef("refs/heads/b",
|
RefRename renameRef = db.renameRef("refs/heads/b",
|
||||||
|
@ -669,7 +669,7 @@ public void testRenameBranchAlsoInPack() throws IOException {
|
||||||
Result update = updateRef.update();
|
Result update = updateRef.update();
|
||||||
assertEquals("internal check new ref is loose", Result.FORCED, update);
|
assertEquals("internal check new ref is loose", Result.FORCED, update);
|
||||||
assertEquals(Ref.Storage.LOOSE, db.getRef("refs/heads/b").getStorage());
|
assertEquals(Ref.Storage.LOOSE, db.getRef("refs/heads/b").getStorage());
|
||||||
writeReflog(db, rb, rb, "Just a message", "refs/heads/b");
|
writeReflog(db, rb, "Just a message", "refs/heads/b");
|
||||||
assertTrue("log on old branch", new File(db.getDirectory(),
|
assertTrue("log on old branch", new File(db.getDirectory(),
|
||||||
"logs/refs/heads/b").exists());
|
"logs/refs/heads/b").exists());
|
||||||
RefRename renameRef = db.renameRef("refs/heads/b",
|
RefRename renameRef = db.renameRef("refs/heads/b",
|
||||||
|
@ -699,8 +699,7 @@ public void tryRenameWhenLocked(String toLock, String fromName,
|
||||||
writeSymref(Constants.HEAD, headPointsTo);
|
writeSymref(Constants.HEAD, headPointsTo);
|
||||||
ObjectId oldfromId = db.resolve(fromName);
|
ObjectId oldfromId = db.resolve(fromName);
|
||||||
ObjectId oldHeadId = db.resolve(Constants.HEAD);
|
ObjectId oldHeadId = db.resolve(Constants.HEAD);
|
||||||
writeReflog(db, oldfromId, oldfromId, "Just a message",
|
writeReflog(db, oldfromId, "Just a message", fromName);
|
||||||
fromName);
|
|
||||||
List<org.eclipse.jgit.storage.file.ReflogEntry> oldFromLog = db
|
List<org.eclipse.jgit.storage.file.ReflogEntry> oldFromLog = db
|
||||||
.getReflogReader(fromName).getReverseEntries();
|
.getReflogReader(fromName).getReverseEntries();
|
||||||
List<org.eclipse.jgit.storage.file.ReflogEntry> oldHeadLog = oldHeadId != null ? db
|
List<org.eclipse.jgit.storage.file.ReflogEntry> oldHeadLog = oldHeadId != null ? db
|
||||||
|
@ -806,7 +805,7 @@ public void testRenameRefNameColission1avoided() throws IOException {
|
||||||
assertEquals(Result.FAST_FORWARD, updateRef.update());
|
assertEquals(Result.FAST_FORWARD, updateRef.update());
|
||||||
ObjectId oldHead = db.resolve(Constants.HEAD);
|
ObjectId oldHead = db.resolve(Constants.HEAD);
|
||||||
assertTrue(rb.equals(oldHead)); // assumption for this test
|
assertTrue(rb.equals(oldHead)); // assumption for this test
|
||||||
writeReflog(db, rb, rb, "Just a message", "refs/heads/a");
|
writeReflog(db, rb, "Just a message", "refs/heads/a");
|
||||||
assertTrue("internal check, we have a log", new File(db.getDirectory(),
|
assertTrue("internal check, we have a log", new File(db.getDirectory(),
|
||||||
"logs/refs/heads/a").exists());
|
"logs/refs/heads/a").exists());
|
||||||
|
|
||||||
|
@ -840,8 +839,7 @@ public void testRenameRefNameColission2avoided() throws IOException {
|
||||||
assertEquals(Result.FORCED, updateRef.update());
|
assertEquals(Result.FORCED, updateRef.update());
|
||||||
ObjectId oldHead = db.resolve(Constants.HEAD);
|
ObjectId oldHead = db.resolve(Constants.HEAD);
|
||||||
assertTrue(rb.equals(oldHead)); // assumption for this test
|
assertTrue(rb.equals(oldHead)); // assumption for this test
|
||||||
writeReflog(db, rb, rb, "Just a message",
|
writeReflog(db, rb, "Just a message", "refs/heads/prefix/a");
|
||||||
"refs/heads/prefix/a");
|
|
||||||
assertTrue("internal check, we have a log", new File(db.getDirectory(),
|
assertTrue("internal check, we have a log", new File(db.getDirectory(),
|
||||||
"logs/refs/heads/prefix/a").exists());
|
"logs/refs/heads/prefix/a").exists());
|
||||||
|
|
||||||
|
@ -864,8 +862,8 @@ public void testRenameRefNameColission2avoided() throws IOException {
|
||||||
"HEAD").getReverseEntries().get(0).getComment());
|
"HEAD").getReverseEntries().get(0).getComment());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeReflog(Repository db, ObjectId oldId, ObjectId newId,
|
private void writeReflog(Repository db, ObjectId newId, String msg,
|
||||||
String msg, String refName) throws IOException {
|
String refName) throws IOException {
|
||||||
RefDirectory refs = (RefDirectory) db.getRefDatabase();
|
RefDirectory refs = (RefDirectory) db.getRefDatabase();
|
||||||
RefDirectoryUpdate update = refs.newUpdate(refName, true);
|
RefDirectoryUpdate update = refs.newUpdate(refName, true);
|
||||||
update.setNewObjectId(newId);
|
update.setNewObjectId(newId);
|
||||||
|
|
|
@ -524,7 +524,6 @@ boolean readAhead(ReadableChannel rc, DfsPackKey key, int size, long pos,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private <T> T scan(HashEntry n, DfsPackKey pack, long position) {
|
private <T> T scan(HashEntry n, DfsPackKey pack, long position) {
|
||||||
Ref<T> r = scanRef(n, pack, position);
|
Ref<T> r = scanRef(n, pack, position);
|
||||||
return r != null ? r.get() : null;
|
return r != null ? r.get() : null;
|
||||||
|
|
|
@ -541,7 +541,6 @@ public void writeObjects(PackOutputStream out, List<ObjectToPack> list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Collection<CachedPack> getCachedPacks() throws IOException {
|
public Collection<CachedPack> getCachedPacks() throws IOException {
|
||||||
DfsPackFile[] packList = db.getPacks();
|
DfsPackFile[] packList = db.getPacks();
|
||||||
List<CachedPack> cached = new ArrayList<CachedPack>(packList.length);
|
List<CachedPack> cached = new ArrayList<CachedPack>(packList.length);
|
||||||
|
|
|
@ -120,7 +120,6 @@ public B setup() throws IllegalArgumentException, IOException {
|
||||||
* the repository could not be accessed to configure the rest of
|
* the repository could not be accessed to configure the rest of
|
||||||
* the builder's parameters.
|
* the builder's parameters.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public abstract R build() throws IOException;
|
public abstract R build() throws IOException;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue