@Override public void run() { if (repo.isOpen()) { BlobStore blobs = repo.blobStore(); blobs.removeBlob(deleteKey); } } }, 60, TimeUnit.SECONDS);
private void skipCurrentCommit() { List<String> nextFile = Blobs.readLines(context().blobStore(), REBASE_NEXT_BLOB); try { String idx = nextFile.get(0); String blobName = REBASE_BLOB_PREFIX + idx; context().blobStore().removeBlob(blobName); int newIdx = Integer.parseInt(idx) + 1; Blobs.putBlob(context().blobStore(), REBASE_NEXT_BLOB, String.valueOf(newIdx)); } catch (Exception e) { throw new IllegalStateException("Cannot read/write rebase commits index", e); } }
private void skipCurrentCommit() { List<String> nextFile = Blobs.readLines(context().blobStore(), REBASE_NEXT_BLOB); try { String idx = nextFile.get(0); String blobName = REBASE_BLOB_PREFIX + idx; context().blobStore().removeBlob(blobName); int newIdx = Integer.parseInt(idx) + 1; Blobs.putBlob(context().blobStore(), REBASE_NEXT_BLOB, String.valueOf(newIdx)); } catch (Exception e) { throw new IllegalStateException("Cannot read/write rebase commits index", e); } }
@Override protected ImmutableList<String> _call() { Builder<String> cleaned = new ImmutableList.Builder<String>(); Optional<Ref> ref = command(UpdateRef.class).setDelete(true).setName(Ref.MERGE_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.MERGE_HEAD); } ref = command(UpdateRef.class).setDelete(true).setName(Ref.ORIG_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.ORIG_HEAD); } ref = command(UpdateRef.class).setDelete(true).setName(Ref.CHERRY_PICK_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.CHERRY_PICK_HEAD); } BlobStore blobStore = context.blobStore(); Optional<byte[]> blob = Blobs.getBlob(blobStore, MergeOp.MERGE_MSG); if (blob.isPresent()) { cleaned.add(MergeOp.MERGE_MSG); blobStore.removeBlob(MergeOp.MERGE_MSG); } return cleaned.build(); }
private boolean applyNextCommit(boolean useCommitChanges) { List<String> nextFile = Blobs.readLines(context().blobStore(), REBASE_NEXT_BLOB); if (nextFile.isEmpty()) { return false; } String idx = nextFile.get(0); String blobName = REBASE_BLOB_PREFIX + idx; List<String> commitFile = Blobs.readLines(context().blobStore(), blobName); if (commitFile.isEmpty()) { return false; } String commitId = commitFile.get(0); RevCommit commit = objectDatabase().getCommit(ObjectId.valueOf(commitId)); applyCommit(commit, useCommitChanges); context().blobStore().removeBlob(blobName); int newIdx = Integer.parseInt(idx) + 1; try { Blobs.putBlob(context().blobStore(), REBASE_NEXT_BLOB, String.valueOf(newIdx)); } catch (Exception e) { throw new IllegalStateException("Cannot read/write rebase commits index", e); } return true; }
private boolean applyNextCommit(boolean useCommitChanges) { List<String> nextFile = Blobs.readLines(context().blobStore(), REBASE_NEXT_BLOB); if (nextFile.isEmpty()) { return false; } String idx = nextFile.get(0); String blobName = REBASE_BLOB_PREFIX + idx; List<String> commitFile = Blobs.readLines(context().blobStore(), blobName); if (commitFile.isEmpty()) { return false; } String commitId = commitFile.get(0); RevCommit commit = objectDatabase().getCommit(ObjectId.valueOf(commitId)); applyCommit(commit, useCommitChanges); context().blobStore().removeBlob(blobName); int newIdx = Integer.parseInt(idx) + 1; try { Blobs.putBlob(context().blobStore(), REBASE_NEXT_BLOB, String.valueOf(newIdx)); } catch (Exception e) { throw new IllegalStateException("Cannot read/write rebase commits index", e); } return true; }
context().blobStore().removeBlob(commitBlobName); int newIdx = Integer.parseInt(idx) + 1; putBlob(context().blobStore(), NEXT, Integer.toString(newIdx));
@Override protected ImmutableList<String> _call() { Builder<String> cleaned = new ImmutableList.Builder<String>(); Optional<Ref> ref = command(RefParse.class).setName(Ref.MERGE_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.MERGE_HEAD); command(UpdateRef.class).setDelete(true).setName(Ref.MERGE_HEAD).call(); } ref = command(RefParse.class).setName(Ref.ORIG_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.ORIG_HEAD); command(UpdateRef.class).setDelete(true).setName(Ref.ORIG_HEAD).call(); } ref = command(RefParse.class).setName(Ref.CHERRY_PICK_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.CHERRY_PICK_HEAD); command(UpdateRef.class).setDelete(true).setName(Ref.CHERRY_PICK_HEAD).call(); } BlobStore blobStore = context.blobStore(); Optional<String> blob = Blobs.getBlobAsString(blobStore, MergeOp.MERGE_MSG); if (blob.isPresent()) { cleaned.add(MergeOp.MERGE_MSG); blobStore.removeBlob(MergeOp.MERGE_MSG); } return cleaned.build(); }
context().blobStore().removeBlob(commitBlobName); int newIdx = Integer.parseInt(idx) + 1; putBlob(context().blobStore(), NEXT, Integer.toString(newIdx));
context().blobStore().removeBlob(REBASE_SQUASH_BLOB); command(UpdateRef.class).setDelete(true).setName(Ref.ORIG_HEAD).call(); context().blobStore().removeBlob(REBASE_BRANCH_BLOB);
context().blobStore().removeBlob(REBASE_SQUASH_BLOB); command(UpdateRef.class).setDelete(true).setName(Ref.ORIG_HEAD).call(); context().blobStore().removeBlob(REBASE_BRANCH_BLOB);