Skip to content

Commit

Permalink
Fixes for npm and git 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Amor Kvalheim committed Aug 31, 2010
1 parent 202088d commit ef36acb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions install.sh
@@ -1,4 +1,6 @@
cd ./external-libs/node-compress
rm -rf ./build
rm compress.node
node-waf configure
node-waf build
cd ..
Expand Down
2 changes: 1 addition & 1 deletion lib/git/pack_storage.js
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/git/repository.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion 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 <christkv@gmail.com>"
, "contributors" : []
Expand Down
2 changes: 1 addition & 1 deletion test/test_commit.js
Expand Up @@ -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();
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/test_git.js
Expand Up @@ -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();
})
},
Expand All @@ -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();
})
},
Expand Down
4 changes: 2 additions & 2 deletions test/test_git_index.js
Expand Up @@ -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 <tom@example.com>");

// Fetch the commits
repo.commits(function(err, commits) {
var sha = commits[0].tree.id;
Expand Down

0 comments on commit ef36acb

Please sign in to comment.