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
{ | |
"Products" : [{ | |
"name": "Socket" | |
}, { | |
"name": "Pole1" | |
}, { | |
"name": "Rocker1" | |
}], | |
"Resources" : [{ | |
"name": "Linefeed1" |
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
String workingTreeDir = getWorkingTreeDir(); | |
Git git = new Git(repository)); | |
// Checking out the query branch and loading the query | |
git.checkout().setName("refs/heads/queries").call(); | |
Path path = Paths.get(workingTreeDir, DigestUtils.sha1Hex(pid) + ".query"); | |
Properties properties = properties.load(Files.newBufferedReader(path)) | |
// Extracting the commit hash from the metadata file | |
Query query = new DefaultQuery(properties.getProperty("commit")); |
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
Git git = new Git(repository); | |
String pid = query.getPid().getIdentifier(); | |
PersonIdent personIdent = new PersonIdent("Jane Doe","doe@gmail.com"); | |
String message = "Created query file for PID=" + pid; | |
// Building the SHA1 hash for the PID | |
String fileName = DigestUtils.sha1Hex(pid) + ".query"; | |
// Retrieving the queries branch | |
git.checkout().setName("refs/heads/queries").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
Git git = new Git(repository); | |
// Creating the master branch if it doesn't exist | |
ObjectId head = repository.resolve("refs/heads/master"); | |
if (head != null) { return; } | |
// Creating the initial commit on the branch | |
git.commit().setMessage("Initial commit").call(); | |
String readmeFileName = "README.md"; |