Skip to content

Commit 92f55fb

Browse files
committed
Remove undocumented worktre.git_path
Fixes #803
1 parent 25eb226 commit 92f55fb

File tree

6 files changed

+11
-32
lines changed

6 files changed

+11
-32
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
Breaking changes:
2424

2525
- Now `worktree.path` returns the path to the worktree directory, not to the
26-
`.git` file within. To get the path to the `.git` file just append `.git`
26+
`.git` file within
27+
`#803 <https://github.com/libgit2/pygit2/issues/803>`_
28+
29+
- Remove undocumented `worktree.git_path`
2730
`#803 <https://github.com/libgit2/pygit2/issues/803>`_
2831

2932

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Usage guide:
5050
settings
5151
submodule
5252
working-copy
53+
worktree
5354

5455

5556
Indices and tables

docs/worktree.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**********************************************************************
2+
Worktree
3+
**********************************************************************
4+
5+
.. autoclass:: pygit2.Worktree
6+
:members:

src/worktree.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ Worktree_path__get__(Worktree *self)
5050
return to_unicode(git_worktree_path(self->worktree), NULL, NULL);
5151
}
5252

53-
PyDoc_STRVAR(Worktree_git_path__doc__,
54-
"Gets dir within .git path\n");
55-
PyObject *
56-
Worktree_git_path__get__(Worktree *self)
57-
{
58-
return to_unicode(self->worktree->gitdir_path, NULL, NULL);
59-
}
60-
6153
PyDoc_STRVAR(Worktree_is_prunable__doc__,
6254
"Is the worktree prunable with the given set of flags?\n");
6355
PyObject *
@@ -105,7 +97,6 @@ PyMethodDef Worktree_methods[] = {
10597

10698
PyGetSetDef Worktree_getseters[] = {
10799
GETTER(Worktree, path),
108-
GETTER(Worktree, git_path),
109100
GETTER(Worktree, name),
110101
GETTER(Worktree, is_prunable),
111102
{NULL}

src/worktree.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,6 @@
3333
#include <git2.h>
3434
#include <git2/worktree.h>
3535

36-
/* git_worktree is an internal unstable datastructure (#803) */
37-
struct git_worktree {
38-
char *name;
39-
char *worktree_path;
40-
char *gitlink_path;
41-
char *gitdir_path;
42-
char *commondir_path;
43-
char *parent_path;
44-
int locked:1;
45-
};
46-
4736
PyObject* wrap_worktree(Repository* repo, git_worktree* wt);
4837

4938
#endif

test/test_repository.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -696,15 +696,6 @@ def _check_worktree(worktree):
696696
# file.
697697
assert os.path.isfile(os.path.join(worktree_dir, '.git'))
698698

699-
# Confirm the git_path attribute points to the correct path
700-
git_path = os.path.realpath(
701-
os.path.join(self.repo.path, 'worktrees', worktree_name))
702-
assert os.path.realpath(worktree.git_path) == git_path
703-
704-
# Confirm the worktree directory in the main checkout's gitdir
705-
# actually exists
706-
assert os.path.isdir(git_path)
707-
708699
# We should have zero worktrees
709700
assert self.repo.list_worktrees() == []
710701
# Add a worktree
@@ -726,5 +717,3 @@ def _check_worktree(worktree):
726717
# something to take up with libgit2.
727718
worktree.prune(True)
728719
assert self.repo.list_worktrees() == []
729-
# Confirm that the repo's data dir has been removed
730-
assert not os.path.isdir(worktree.git_path)

0 commit comments

Comments
 (0)