revert: feat: create annotated tags

This reverts commit 4d581fc140.
This commit is contained in:
Pierre Vanduynslager
2019-09-13 14:46:47 -04:00
parent d120eaea8b
commit 0629f3cd8a
5 changed files with 11 additions and 18 deletions
+3 -3
View File
@@ -183,7 +183,7 @@ test('Add tag on head commit', async t => {
const {cwd} = await gitRepo();
const commits = await gitCommits(['Test commit'], {cwd});
await tag({gitTag: 'tag_name', gitHead: 'HEAD', version: '1.0.0'}, {cwd});
await tag('tag_name', 'HEAD', {cwd});
await t.is(await gitCommitTag(commits[0].hash, {cwd}), 'tag_name');
});
@@ -193,7 +193,7 @@ test('Push tag to remote repository', async t => {
const {cwd, repositoryUrl} = await gitRepo(true);
const commits = await gitCommits(['Test commit'], {cwd});
await tag({gitTag: 'tag_name', gitHead: 'HEAD', version: '1.0.0'}, {cwd});
await tag('tag_name', 'HEAD', {cwd});
await push(repositoryUrl, {cwd});
t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
@@ -207,7 +207,7 @@ test('Push tag to remote repository with remote branch ahead', async t => {
await gitCommits(['Second'], {cwd: tmpRepo});
await gitPush('origin', 'master', {cwd: tmpRepo});
await tag({gitTag: 'tag_name', gitHead: 'HEAD', version: '1.0.0'}, {cwd});
await tag('tag_name', 'HEAD', {cwd});
await push(repositoryUrl, {cwd});
t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
+1 -1
View File
@@ -195,7 +195,7 @@ export function gitTagHead(tagName, execaOpts) {
* @return {String} The sha of the commit associated with `tagName` on the remote repository.
*/
export async function gitRemoteTagHead(repositoryUrl, tagName, execaOpts) {
return (await execa.stdout('git', ['ls-remote', repositoryUrl, `${tagName}^{}`], execaOpts))
return (await execa.stdout('git', ['ls-remote', '--tags', repositoryUrl, tagName], execaOpts))
.split('\n')
.filter(tag => Boolean(tag))
.map(tag => tag.match(/^(\S+)/)[1])[0];