Skip to content

Finish worktree support - #779

Merged
jdavid merged 9 commits into
libgit2:masterfrom
terminalmage:rebased-worktrees
Mar 18, 2018
Merged

Finish worktree support#779
jdavid merged 9 commits into
libgit2:masterfrom
terminalmage:rebased-worktrees

Conversation

@terminalmage

@terminalmage terminalmage commented Mar 18, 2018

Copy link
Copy Markdown
Contributor

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

jdavid commented Mar 18, 2018

Copy link
Copy Markdown
Member

Thanks!

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

@terminalmage

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Windows tests passing now. 🎉

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

jdavid commented Mar 18, 2018

Copy link
Copy Markdown
Member

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