Permalink
Browse files

Fixed more commit/tag parsing bugs

  • Loading branch information...
1 parent e70b785 commit 3d3df8d5d08162e568a7adab0f5588d6f9374178 @tarruda committed Jan 17, 2013
Showing with 4 additions and 6 deletions.
  1. +2 −3 src/js/commit.js
  2. +2 −3 src/js/tag.js
View
@@ -38,8 +38,7 @@ Commit.prototype.serialize = function(visitor) {
if (!this.committer) this.committer = this.author;
contentArray.push("committer " + this.committer.name + " <" +
(this.committer.email || '') + "> " +
- common.timestamp(this.committer.date));
- contentArray.push('\n');
+ common.timestamp(this.committer.date) + '\n');
contentArray.push(this.message);
return this._serialize(new Buffer(contentArray.join('\n')), visitor);
@@ -98,7 +97,7 @@ Commit.deserialize = function(contents) {
pos += Buffer.byteLength(match[0]) + 1;
}
- pos += 2;
+ pos += 1;
// message
message = info.contents.slice(pos).toString('utf8');
View
@@ -34,8 +34,7 @@ Tag.prototype.serialize = function(visitor) {
contentArray.push("tag " + this.name);
contentArray.push("tagger " + this.tagger.name + " <" +
(this.tagger.email || '') + "> " +
- common.timestamp(this.date));
- contentArray.push('\n');
+ common.timestamp(this.date) + '\n');
contentArray.push(this.message);
return this._serialize(new Buffer(contentArray.join('\n')), visitor);
@@ -85,7 +84,7 @@ Tag.deserialize = function(contents) {
pos += Buffer.byteLength(match[0]) + 1;
}
- pos += 2;
+ pos += 1;
// message
message = info.contents.slice(pos).toString('utf8');

0 comments on commit 3d3df8d

Please sign in to comment.