Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a2856af

Browse files
committed
Update tutorial to demonstrate dict-like tree objects.
1 parent 5d3e2f7 commit a2856af

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/tutorial.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ This tree contains three ``Blob`` objects and one ``Tree`` object. The trees
124124
are subdirectories and the blobs are files. Trees below the root have
125125
additional attributes.
126126

127-
>>> contents = tree.contents[-2]
128-
<GitPython.Tree "e5445b9db4a9f08d5b4de4e29e61dffda2f386ba">
127+
>>> contents = tree["lib"]
128+
<GitPython.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a3">
129129

130130
>>> contents.name
131131
'test'
@@ -134,7 +134,8 @@ additional attributes.
134134
'040000'
135135

136136
There is a convenience method that allows you to get a named sub-object
137-
from a tree.
137+
from a tree with a syntax similar to how paths are written in an unix
138+
system.
138139

139140
>>> tree/"lib"
140141
<GitPython.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30">

0 commit comments

Comments
 (0)