Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.IndexDiff$WorkingTreeIteratorFactory


        Repository repo = Git.getInstance().getRepository(root);
        Map<File, StatusInfo> files = new HashMap<File, StatusInfo>();

        try {
            IndexDiff index = new IndexDiff(repo);
            index.diff();

            put(index.getAdded(), relPath, files, root,
                    StatusInfo.STATUS_VERSIONED_ADDEDLOCALLY);
            put(index.getRemoved(), relPath, files, root,
                    StatusInfo.STATUS_VERSIONED_REMOVEDLOCALLY);
            put(index.getMissing(), relPath, files, root,
                    StatusInfo.STATUS_VERSIONED_DELETEDLOCALLY);
            put(index.getChanged(), relPath, files, root,
                    StatusInfo.STATUS_VERSIONED_MODIFIEDLOCALLY);
            put(index.getModified(), relPath, files, root,
                    StatusInfo.STATUS_VERSIONED_MODIFIEDLOCALLY);

            final FileTreeIterator workTree = new FileTreeIterator(repo.getWorkDir());
            final TreeWalk walk = new TreeWalk(repo);
            DirCache cache = DirCache.read(repo);

            walk.reset(); // drop the first empty tree
            walk.setRecursive(true);
            walk.addTree(workTree);

            int share = SharabilityQuery.getSharability(dir);
            if (share == SharabilityQuery.NOT_SHARABLE) {
                return files;
            }
            while (walk.next()) {
                String path = walk.getPathString();

                if (relPath.length() > 0 && !path.startsWith(relPath)) {
                    continue;
                }
                if (index.getAdded().contains(path) ||
                        index.getRemoved().contains(path) ||
                        index.getMissing().contains(path) ||
                        index.getChanged().contains(path) ||
                        index.getModified().contains(path)) {
                    continue;
                }
                DirCacheEntry entry = cache.getEntry(path);
                File file = new File(root, path);
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.IndexDiff$WorkingTreeIteratorFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.