Browse Source

Misc fixes.

tags/v0.5.2
James Moger 13 years ago
parent
commit
a75a1819f4

+ 1
- 2
src/com/gitblit/utils/JGitUtils.java View File

} }
fetch.setRefSpecs(specs); fetch.setRefSpecs(specs);
FetchResult result = fetch.call(); FetchResult result = fetch.call();
repository.close();
return result; return result;
} }
/** /**
* Determine if a repository has any commits. This is determined by checking * Determine if a repository has any commits. This is determined by checking
* for 1 or more heads.
* the objects/info and objects/pack folders.
* *
* @param repository * @param repository
* @return true if the repository has commits * @return true if the repository has commits

+ 2
- 2
tests/com/gitblit/tests/ByteFormatTest.java View File

public void testByteFormat() throws Exception { public void testByteFormat() throws Exception {
ByteFormat format = new ByteFormat(); ByteFormat format = new ByteFormat();
assertTrue(format.format(10).equals("10 b")); assertTrue(format.format(10).equals("10 b"));
assertTrue(format.format(1024 * 10).equals("10.0 KB"));
assertTrue(format.format(1024 * 1000).equals("1,000.0 KB"));
assertTrue(format.format(1024 * 10).equals("10 KB"));
assertTrue(format.format(1024 * 1000).equals("1,000 KB"));
assertTrue(format.format(2 * 1024 * 1000).equals("2.0 MB")); assertTrue(format.format(2 * 1024 * 1000).equals("2.0 MB"));
assertTrue(format.format(1024 * 1024 * 1000).equals("1,000.0 MB")); assertTrue(format.format(1024 * 1024 * 1000).equals("1,000.0 MB"));
assertTrue(format.format(2 * 1024 * 1024 * 1000).equals("2.0 GB")); assertTrue(format.format(2 * 1024 * 1024 * 1000).equals("2.0 GB"));

Loading…
Cancel
Save