Skip to content

Commit 66845ca

Browse files
authored
Merge pull request #66 from courajs/ancestor-tags
Change git-tag-commit data generator to use most recent ancestor tag
2 parents e25153a + 79f9ee6 commit 66845ca

21 files changed

+43
-4
lines changed

lib/data-generators/git-tag-commit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ module.exports = CoreObject.extend({
1717
return RSVP.reject('Could not find git repository');
1818
}
1919

20-
var tag = info.tag;
20+
var tag = info.lastTag;
2121
var sha = info.sha.slice(0, commitHashLength);
2222

23-
if (!info.tag || !sha) {
23+
if (!tag || !sha) {
2424
return RSVP.reject('Could not build revision with tag `' + tag + '` and commit hash `' + sha + '`');
2525
}
2626

2727
return RSVP.resolve({
28-
revisionKey: info.tag + separator + sha,
28+
revisionKey: tag + separator + sha,
2929
timestamp: new Date().toISOString()
3030
});
3131
}

tests/fixtures/repo/file

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Not worth releasing a new version for this
2+
# Please enter the commit message for your changes. Lines starting
3+
# with '#' will be ignored, and an empty message aborts the commit.
4+
#
5+
# On branch master
6+
# Changes to be committed:
7+
# new file: file
8+
#
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ref: refs/heads/master
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[core]
2+
repositoryformatversion = 0
3+
filemode = true
4+
bare = false
5+
logallrefupdates = true
6+
ignorecase = true
7+
precomposeunicode = true
297 Bytes
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
41d41f081b45ad50935c08b1203220737d9739b4 483354f68439a3ff2306276b211e7a9c1678d4a6 Aaron Sikes <aaron@sikes.io> 1522436612 -0400 commit: Not worth releasing a new version for this
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
41d41f081b45ad50935c08b1203220737d9739b4 483354f68439a3ff2306276b211e7a9c1678d4a6 Aaron Sikes <aaron@sikes.io> 1522436612 -0400 commit: Not worth releasing a new version for this

tests/fixtures/tagged-ancestor-repo/dotgit/objects/41/d41f081b45ad50935c08b1203220737d9739b4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
x��A
2+
1 @Q�=E��4�L����"Ӧ�Z��������������7H��g�0N�GN�샥A�'&&t9~�Gmp^��X��E�Mp�_;��ֶ��~\���ak�Z��.2��Ԯ����OB�

0 commit comments

Comments
 (0)