diff --git a/install.sh b/install.sh index 39e7de8..ae8c24c 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,6 @@ cd ./external-libs/node-compress +rm -rf ./build +rm compress.node node-waf configure node-waf build cd .. diff --git a/lib/git/pack_storage.js b/lib/git/pack_storage.js index 79153c0..c274386 100644 --- a/lib/git/pack_storage.js +++ b/lib/git/pack_storage.js @@ -263,7 +263,7 @@ var find_object_in_index = function(pack, idx, sha1) { for(var i = 0; i < midsha1.length; i++) { compare_sha1 = compare_sha1 + String.fromCharCode(midsha1[i]); } - + // Do a locale Compare var cmp = compare_sha1.localeCompare(sha1); if(cmp < 0) { diff --git a/lib/git/repository.js b/lib/git/repository.js index 0850271..4fd7521 100644 --- a/lib/git/repository.js +++ b/lib/git/repository.js @@ -173,8 +173,7 @@ var get_raw_object_by_sha1 = function(repo, sha1o) { // try packs again maybe the object got packed in the meantime initpacks(repo); // Try packs - var packs = repo.packs; - + var packs = repo.packs; for(var i = 0; i < packs.length; i++) { var o = packs[i].find(sha1); if(o != null) return o; @@ -466,6 +465,7 @@ var walk_log = function(repo, sha, options, total_size) { if(sha) { // Get the raw object o = get_raw_object_by_sha1(repo, sha); + // Create a git object from the raw object if(o.type == "tag") { commit_sha = repo.get_object_by_sha1(sha).object; diff --git a/package.json b/package.json index 4cfa0b4..d18b39b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "git" , "description" : "A node.js library for git" -, "version" : "0.1" +, "version" : "0.1.0" , "scripts" : { "install" : "./install.sh" } , "author" : "Christian Amor Kvalheim " , "contributors" : [] diff --git a/test/test_commit.js b/test/test_commit.js index 08c8e2a..f364e17 100644 --- a/test/test_commit.js +++ b/test/test_commit.js @@ -272,7 +272,7 @@ suite.addTests({ assert.ok(patch.indexOf('test/test_reality.rb | 30 +++++++++++++++---------------') != -1); assert.ok(patch.indexOf('@@ -1,17 +1,17 @@') != -1); assert.ok(patch.indexOf('+# recurse(t)') != -1); - assert.ok(patch.indexOf('1.6.') != -1); + assert.ok(patch.indexOf('1.7.') != -1); finished(); }); }); diff --git a/test/test_git.js b/test/test_git.js index 53a8fd4..19c0bb6 100644 --- a/test/test_git.js +++ b/test/test_git.js @@ -24,7 +24,7 @@ suite.addTests({ var git = new Git("./test/grit"); git.git('bad', function(err, result) { assert.ok(err); - assert.ok(err.indexOf("git: 'bad' is not a git-command") != -1); + assert.ok(err.indexOf("git: 'bad' is not a git command") != -1); finished(); }) }, @@ -33,7 +33,7 @@ suite.addTests({ var git = new Git("./test/grit"); git.git('bad', {timeout:false}, function(err, result) { assert.ok(err); - assert.ok(err.indexOf("git: 'bad' is not a git-command") != -1); + assert.ok(err.indexOf("git: 'bad' is not a git command") != -1); finished(); }) }, diff --git a/test/test_git_index.js b/test/test_git_index.js index 6d9dcc2..1b3a2c5 100644 --- a/test/test_git_index.js +++ b/test/test_git_index.js @@ -167,12 +167,12 @@ suite.addTests({ "Should correctly modify file":function(assert, finished) { var base_repo = "./test/dot_git_iv2" - + create_tmp_directory(base_repo, function(err, target_path) { new Repo(target_path + "/dot_git_iv2", {is_bare:true}, function(err, repo) { var repository = repo.git.repository; var user = Actor.from_string("Tom Werner "); - + // Fetch the commits repo.commits(function(err, commits) { var sha = commits[0].tree.id;