| | |
| | |
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.TicGitTicket;
|
| | | import com.gitblit.wicket.models.PathModel;
|
| | | import com.gitblit.wicket.models.RefModel;
|
| | |
|
| | |
|
| | | public class JGitUtilsTest extends TestCase {
|
| | |
|
| | |
| | | r.close();
|
| | | }
|
| | |
|
| | | public void testFilesInCommit() throws Exception {
|
| | | Repository r = getRepository();
|
| | | RevCommit commit = JGitUtils.getCommit(r, Constants.HEAD);
|
| | | List<PathModel> paths = JGitUtils.getFilesInCommit(r, commit);
|
| | | r.close();
|
| | | assertTrue("No changed paths found!", paths.size() > 0);
|
| | | }
|
| | | |
| | | public void testCommitDiff() throws Exception {
|
| | | Repository r = getRepository();
|
| | | RevCommit commit = JGitUtils.getCommit(r, Constants.HEAD);
|
| | | String diff = JGitUtils.getCommitDiff(r, commit, false);
|
| | | r.close();
|
| | | System.out.println(diff);
|
| | | }
|
| | |
|
| | | }
|