/** {@inheritDoc} */ @Override public boolean exists() { return fs.exists(objects); }
@Override public boolean isModified(File path) { return FS.DETECTED.exists(path); } };
private static void loadRulesFromFile(IgnoreNode r, File exclude) throws FileNotFoundException, IOException { if (FS.DETECTED.exists(exclude)) { try (FileInputStream in = new FileInputStream(exclude)) { r.parse(in); } } } }
File of = new File(workTree, tw.getPathString()); File parentFolder = of.getParentFile(); if (!fs.exists(parentFolder)) { parentFolder.mkdirs();
@Override public boolean isModified(File path) { return FS.DETECTED.exists(path); } };
@Override public boolean isModified(File path) { return FS.DETECTED.exists(path); } };
@Override public boolean exists() { return fs.exists(objects); }
/** {@inheritDoc} */ @Override public boolean exists() { return fs.exists(objects); }
String r = removed.get(i); file = new File(repo.getWorkTree(), r); if (!file.delete() && repo.getFS().exists(file)) {
if (!fs.exists(refFile)) { continue;
private RevCommit checkoutCurrentHead() throws IOException, NoHeadException { ObjectId headTree = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$ if (headTree == null) throw new NoHeadException( JGitText.get().cannotRebaseWithoutCurrentHead); DirCache dc = repo.lockDirCache(); try { DirCacheCheckout dco = new DirCacheCheckout(repo, dc, headTree); dco.setFailOnConflict(false); dco.setProgressMonitor(monitor); boolean needsDeleteFiles = dco.checkout(); if (needsDeleteFiles) { List<String> fileList = dco.getToBeDeleted(); for (String filePath : fileList) { File fileToDelete = new File(repo.getWorkTree(), filePath); if (repo.getFS().exists(fileToDelete)) FileUtils.delete(fileToDelete, FileUtils.RECURSIVE | FileUtils.RETRY); } } } finally { dc.unlock(); } try (RevWalk rw = new RevWalk(repo)) { RevCommit commit = rw.parseCommit(repo.resolve(Constants.HEAD)); return commit; } }
private static void loadRulesFromFile(IgnoreNode r, File exclude) throws FileNotFoundException, IOException { if (FS.DETECTED.exists(exclude)) { FileInputStream in = new FileInputStream(exclude); try { r.parse(in); } finally { in.close(); } } } }
private static void loadRulesFromFile(IgnoreNode r, File exclude) throws FileNotFoundException, IOException { if (FS.DETECTED.exists(exclude)) { try (FileInputStream in = new FileInputStream(exclude)) { r.parse(in); } } } }
/** * Writes merged file content to the working tree. * * @param result * the result of the content merge * @return the working tree file to which the merged content was written. * @throws FileNotFoundException * @throws IOException */ private File writeMergedFile(MergeResult<RawText> result) throws FileNotFoundException, IOException { File workTree = db.getWorkTree(); FS fs = db.getFS(); File of = new File(workTree, tw.getPathString()); File parentFolder = of.getParentFile(); if (!fs.exists(parentFolder)) parentFolder.mkdirs(); try (OutputStream os = new BufferedOutputStream( new FileOutputStream(of))) { new MergeFormatter().formatMerge(os, result, Arrays.asList(commitNames), CHARACTER_ENCODING); } return of; }
long sleepTime = 64; FS fs = FS.DETECTED; if (lastFile != null && !fs.exists(lastFile)) throw new FileNotFoundException(lastFile.getPath()); File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null);
long sleepTime = 64; FS fs = FS.DETECTED; if (lastFile != null && !fs.exists(lastFile)) throw new FileNotFoundException(lastFile.getPath()); File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null);
File of = new File(workTree, tw.getPathString()); File parentFolder = of.getParentFile(); if (!fs.exists(parentFolder)) { parentFolder.mkdirs();
private RevCommit checkoutCurrentHead() throws IOException, NoHeadException { ObjectId headTree = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$ if (headTree == null) throw new NoHeadException( JGitText.get().cannotRebaseWithoutCurrentHead); DirCache dc = repo.lockDirCache(); try { DirCacheCheckout dco = new DirCacheCheckout(repo, dc, headTree); dco.setFailOnConflict(false); boolean needsDeleteFiles = dco.checkout(); if (needsDeleteFiles) { List<String> fileList = dco.getToBeDeleted(); for (String filePath : fileList) { File fileToDelete = new File(repo.getWorkTree(), filePath); if (repo.getFS().exists(fileToDelete)) FileUtils.delete(fileToDelete, FileUtils.RECURSIVE | FileUtils.RETRY); } } } finally { dc.unlock(); } try (RevWalk rw = new RevWalk(repo)) { RevCommit commit = rw.parseCommit(repo.resolve(Constants.HEAD)); return commit; } }
private RevCommit checkoutCurrentHead() throws IOException, NoHeadException { ObjectId headTree = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$ if (headTree == null) throw new NoHeadException( JGitText.get().cannotRebaseWithoutCurrentHead); DirCache dc = repo.lockDirCache(); try { DirCacheCheckout dco = new DirCacheCheckout(repo, dc, headTree); dco.setFailOnConflict(false); dco.setProgressMonitor(monitor); boolean needsDeleteFiles = dco.checkout(); if (needsDeleteFiles) { List<String> fileList = dco.getToBeDeleted(); for (String filePath : fileList) { File fileToDelete = new File(repo.getWorkTree(), filePath); if (repo.getFS().exists(fileToDelete)) FileUtils.delete(fileToDelete, FileUtils.RECURSIVE | FileUtils.RETRY); } } } finally { dc.unlock(); } try (RevWalk rw = new RevWalk(repo)) { RevCommit commit = rw.parseCommit(repo.resolve(Constants.HEAD)); return commit; } }