This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::sync::mpsc; | |
use std::sync::mpsc::{Receiver, Sender}; | |
use std::sync::{Arc, Mutex}; | |
use std::thread; | |
fn main() { | |
let pool = Arc::new(Pool::new()); | |
let mut handles = Vec::new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Optional<RevCommit> findForkPoint(Repository repository, String base, String tip) throws IOException { | |
try (RevWalk walk = new RevWalk(repository)) { | |
RevCommit tipCommit = walk.lookupCommit(repository.resolve(tip)); | |
List<ReflogEntry> reflog = repository.getReflogReader(base).getReverseEntries(); | |
if (reflog.isEmpty()) { | |
return Optional.empty(); | |
} | |
// The `<=` is deliberate because we want to check both new and old IDs for the oldest entry | |
for (int i = 0; i <= reflog.size(); i++) { | |
ObjectId id = i < reflog.size() ? reflog.get(i).getNewId() : reflog.get(i - 1).getOldId(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a_ a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class VarargWithArray { | |
public static void main(String[] args) { | |
int[] ints = {1, 2, 3}; | |
MyList l = new MyList(ints); | |
ints[0] = 666; | |
System.out.println(l); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testCheckoutOfDirectoryShouldBeRecursive() throws Exception { | |
File a = writeTrashFile("dir/a.txt", "A"); | |
File b = writeTrashFile("dir/sub/b.txt", "B"); | |
git.add().addFilepattern("dir").call(); | |
write(a, "modified"); | |
write(b, "modified"); | |
git.checkout().addPath("dir").call(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Duck { | |
def quack = println("The duck quacks") | |
def walk = println("The duck walks") | |
} | |
class Dog { | |
def quack = println("The dog quacks (barks)") | |
def walk = println("The dog walks") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The information whether head,index,merge iterators are currently | |
// pointing to file/folder/non-existing is encoded into this variable. | |
// | |
// To decode write down ffMask in hexadecimal form. The last digit | |
// represents the state for the merge iterator, the second last the | |
// state for the index iterator and the third last represents the state | |
// for the head iterator. The hexadecimal constant "F" stands for | |
// "file", | |
// an "D" stands for "directory" (tree), and a "0" stands for | |
// non-exisiting |
NewerOlder