Example usage for org.eclipse.jgit.api LogCommand all

List of usage examples for org.eclipse.jgit.api LogCommand all

Introduction

In this page you can find the example usage for org.eclipse.jgit.api LogCommand all.

Prototype

public LogCommand all() throws IOException 

Source Link

Document

Add all refs as commits to start the graph traversal from.

Usage

From source file:com.madgag.agit.LogFragment.java

License:Open Source License

@Override
public Loader<List<RevCommit>> onCreateLoader(int id, Bundle args) {
    return new AsyncLoader<List<RevCommit>>(getActivity()) {
        public List<RevCommit> loadInBackground() {
            Stopwatch stopwatch = new Stopwatch().start();
            Bundle args = getArguments();
            try {
                Repository repo = new FileRepository(args.getString(GITDIR));

                LogCommand log = new Git(repo).log();
                List<String> untilRevs = getArguments().getStringArrayList(UNTIL_REVS);
                if (untilRevs == null || untilRevs.isEmpty()) {
                    log.all();
                } else {
                    for (String untilRev : untilRevs) {
                        log.add(repo.resolve(untilRev));
                    }/*from w  ww.  j a  v a2s  . com*/
                }

                List<RevCommit> sampleRevCommits = newArrayList(log.call());

                Log.d(TAG, "Found " + sampleRevCommits.size() + " commits " + stopwatch);

                return sampleRevCommits;
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    };
}