Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform tag to commit sha when getting notes #1709

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ async function isBranchUpToDate(repositoryUrl, branch, execaOptions) {
*/
async function getNote(ref, execaOptions) {
try {
return JSON.parse((await execa('git', ['notes', '--ref', GIT_NOTE_REF, 'show', ref], execaOptions)).stdout);
const commit = (await execa('git', ['log', '-1', '--pretty=format:%H', ref], execaOptions)).stdout;
return JSON.parse((await execa('git', ['notes', '--ref', GIT_NOTE_REF, 'show', commit], execaOptions)).stdout);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Xunnamius do you think you could add a test to prevent regressions in future?

As mentioned in #1708 we appreciate your thorough research and when in doubt I'd rather merge your change and trust our test suite that no existing use case broke.

@travi brought up this:

My only concern would be if it is something that considers details across branches. I think we're should keep things working from the history of a single branch.

Any thoughts?

} catch (error) {
if (error.exitCode === 1) {
return {};
Expand Down