Skip to content

Conversation

darkowlzz
Copy link
Contributor

This adds a new worktree with 2 repos, rep1 and rep2. rep2 is a shared
repo of rep1 and contains a relative alternates path to rep1. This would
be used to test git alternates.

I didn't find any instructions on adding new fixture and tried to figure out by myself.

  • Created a git repo, rep1. Made an empty commit. Created a shared repo rep2 at the same directory level as rep1. By default, the .git/objects/info/alternates contains absolute path to the source repo's object directory. Changed that to a relative path ../../../rep1//.git/objects.
  • Obtained a hash by doing:
$ find rep1/ rep2/ -type f | sha1sum
a6b6ff89c593f042347113203ead1c14ab5733ce  -
  • Compressed the two repos with:
$ tar -zcvf worktree-a6b6ff89c593f042347113203ead1c14ab5733ce.tgz rep1 rep2
  • Placed this compressed file in the data/ directory.
  • Added a Fixture for the worktree in fixtures.go.

I made all these changes in my $GOPATH. Running the corresponding test for git alternates in go-git repo used the above created fixture and ran the test as expected. The test is at src-d/go-git#663 .

This adds a new worktree with 2 repos, rep1 and rep2. rep2 is a shared
repo of rep1 and contains a relative alternates path to rep1. This would
be used to test git alternates.
@mcuadros
Copy link
Contributor

mcuadros commented Dec 4, 2017

can you rebase? sorry

@mcuadros mcuadros merged commit a29d269 into src-d:master Dec 4, 2017
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.

2 participants