Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed method names in reference example
fixes #98
  • Loading branch information
micha149 committed Oct 4, 2013
commit d706049488ac1139bb8bfa053c89dc4e7da4e6b4
7 changes: 4 additions & 3 deletions example/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ git.Repo.open(path.resolve(__dirname, '../.git'), function(error, repo) {
// **nodegit** uses a simple wrapper around hash values called an `Oid`.
// The oid validates that the SHA is well-formed.

var oid = git.Oid.fromString('fd373a561d63bfc0a5665608fe057f2131d81fee');
var oid = git.Oid.fromString('c27d9c35e3715539d941254f2ce57042b978c49c');

// Most functions in in **nodegit** that take an oid will also take a
// string, so for example, you can look up a commit by a string SHA or
Expand Down Expand Up @@ -175,6 +175,7 @@ git.Repo.open(path.resolve(__dirname, '../.git'), function(error, repo) {
});
});


// #### Tree Parsing

// A Tree is how Git represents the state of the filesystem
Expand Down Expand Up @@ -315,8 +316,8 @@ git.Repo.open(path.resolve(__dirname, '../.git'), function(error, repo) {
repo.getReference(referenceName, function(error, reference) {
if (error) throw error;

if (reference.isOid()) {
console.log("Reference:", referenceName, reference.oid());
if (reference.isConcrete()) {
console.log("Reference:", referenceName, reference.target());
} else if (reference.isSymbolic()) {
console.log("Reference:", referenceName, reference.symbolicTarget());
}
Expand Down