Skip to content

Conversation

@rezib
Copy link
Collaborator

@rezib rezib commented Jan 20, 2026

No description provided.

@rezib rezib requested review from qa-cea and valeriyoann and removed request for qa-cea January 20, 2026 11:13
Copy link
Collaborator

@qa-cea qa-cea left a comment

Choose a reason for hiding this comment

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

Have you encountered this problem often? Pointers generated by Rift should not contain line breaks.

@rezib
Copy link
Collaborator Author

rezib commented Jan 23, 2026

Have you encountered this problem often? Pointers generated by Rift should not contain line breaks.

Personally never! But @valeriyoann did and he thinks Rift should permit this.

if meta.st_size in (32, 64):
# MD5 (32) or SHA3 256 (64). Also accept one or two more bytes to accept
# trailing new line and carriage return characters.
if meta.st_size in (32, 33, 34, 64, 65, 66):
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest: I think it'd be easier to do it in reverse

with open:
    identifier = ...
if identifier.size() not in (32, 64):
    return False

return all(...)

What do you think ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, it makes the logic more simple. Done in 3137f79.

temp_file = make_temp_file(correct_identifier)
self.assertTrue(Annex.is_pointer(temp_file.name))

def test_is_pointer_valid_identifier_with_carriage_return(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest: add the same test for spaces

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in 3137f79.

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

Successfully merging this pull request may close these issues.

3 participants