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

Finish worktree support #779

Merged
merged 9 commits into from
Mar 18, 2018
Merged

Conversation

terminalmage
Copy link
Contributor

@terminalmage terminalmage commented Mar 18, 2018

This adds a unit test to the work done in #719 and #691, so that we can get this feature merged. It's also been rebased again, against the head of the master branch.

Raphael Medaer (Escaux) and others added 8 commits March 18, 2018 14:21
Basic Python binding to:
  - Add a new worktree (Repository#add_worktree(name, path) --> None)
  - List existing worktrees (Repository#list_worktrees() --> [string]
In this commit I added a new PyObject: Worktree.
This is the binding of git_worktree from libgit2.
Still have to implement prune, lock and unlock but you can at list get Worktree name and path.
Implemented Repository#lookup_worktree(name) -> Worktree
Implemented method and getter:
  - Worktree#prune(force=False)
  - Worktree#is_prunable
@jdavid
Copy link
Member

jdavid commented Mar 18, 2018

Thanks!

The test is failing in Windows (AppVeyor), could you check that?

@terminalmage
Copy link
Contributor Author

@jdavid This appears to be due to the fact that pygit2 is using forward slashes as path separators, so they fail the comparison. Should be an easy fix using os.path.realpath() to normalize it.

pygit2 produces paths with forward slashes, while the paths being
compared in the test use escaped backslashes. Using realpath on both the
path emitted by pygit2 and the expected path ensures this difference
does not interfere with comparisons in the test.
@terminalmage
Copy link
Contributor Author

Windows tests passing now. 🎉

@jdavid jdavid merged commit a487044 into libgit2:master Mar 18, 2018
@jdavid
Copy link
Member

jdavid commented Mar 18, 2018

Thanks!

@jdavid jdavid mentioned this pull request Mar 18, 2018
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