Skip to content

Conversation

@phpfui
Copy link
Contributor

@phpfui phpfui commented Mar 20, 2020

Annotated tags are first class git objects and have there own hash and entry in the git repo. As such, a tag really has two hashes, one is the hash of the tag itself. The other is the hash into the source tree that the tag points to. Prior versions of gitlib returned the commit of the tag, rather than the commit of the main source tree. This branch fixes this and gives the user the more logical commit for the tag, which is the commit of the source tree that the annotated tag points to. Lightweight tags are not first class objects and their commit points to the source tree commit. This branch makes the behavior of lightweight and annotated commits the same.

Other improvements made to get unit testing to work on Windows:

  • Updated the foobar repo to use https
  • Changed depreciated assertContains to assertStringContainsString for PHPUnit 9
  • Made method return types compatible with latest PHPUnit
  • Ignore .phpunit.result.cache
  • Rewrite \Gitonomy\Git\Repository::getSize to use built in PHP functions instead of du -skc
  • Rewrite testGetBodyMessage to avoid errors introduced by different git line ending checkout strategies
  • Be directory separator agnostic when testing paths
  • Correct testGetSize to more accurately reflect actual repo size

{
$size = $repository->getSize();
$this->assertGreaterThan(70, $size, 'Repository is greater than 70KB');
$this->assertGreaterThan(65, $size, 'Repository is greater than 65KB');
Copy link
Member

Choose a reason for hiding this comment

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

why is this different?

@phpfui
Copy link
Contributor Author

phpfui commented Mar 20, 2020

I fixed the double rounding issue in getSize, so I think we are good to go now. My initial attempt returned a float, which is no good, but then I guess my various attempts at rounding got out of sync. Now round at the end only.

@GrahamCampbell
Copy link
Member

Please include the size fixes in a separate PR, so the changes are atomic.

@phpfui
Copy link
Contributor Author

phpfui commented Mar 20, 2020

OK, will work on this tonight with new PR.

@GrahamCampbell
Copy link
Member

Great, thanks. :)

@GrahamCampbell
Copy link
Member

I've merged your other changes into master.

@phpfui
Copy link
Contributor Author

phpfui commented Mar 20, 2020 via email

@phpfui phpfui deleted the TagRealCommit branch March 22, 2020 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants