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

If the tag contains 00, it will break there #113

Open
sounisi5011 opened this issue Mar 17, 2023 · 0 comments
Open

If the tag contains 00, it will break there #113

sounisi5011 opened this issue Mar 17, 2023 · 0 comments

Comments

@sounisi5011
Copy link

I tried to push the following tag: v72.94001.10
However, the tag passed to the tag event was the following value:

const { Git } = require('node-git-server');

const repos = new Git('path/to/tmp', {
  autoCreate: true,
});

repos.on('tag', (tag) => {
  // tag.version === 'v72.94' // What!?
});

repos.listen(49152, { type: 'http' }, () => {
  // ...
});
repos.server.on('error', err => { throw err });

Apparently, tag names are cut off when 00 is encountered.
I have looked into the reason for this and found the following regular expression to be the cause.

'receive-pack': '([0-9a-fA-F]+) ([0-9a-fA-F]+) refs\/(heads|tags)\/(.*?)( |00|\u0000)|^(0000)$', // eslint-disable-line

This pattern is defined so that tag names after spaces, null characters, or 00 are not retrieved.
Why? Tag names (and branch names) can contain 00. What is the reason for excluding anything after 00?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant