Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1dfd4a

Browse files
committed
convert from --all flag to all=True
1 parente4bbc7a commita1dfd4a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎test/test_quick_doc.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ def test_cloned_repo_object(self, local_dir):
5757

5858
# [5-test_cloned_repo_object]
5959
file='dir1/file2.txt'# relative path from git root
60-
repo.iter_commits('--all',max_count=100,paths=file)
60+
repo.iter_commits(all=True,max_count=10,paths=file)# gets the last 10 commits from all branches
6161

6262
# Outputs: <generator object Commit._iter_from_process_or_stream at 0x7fb66c186cf0>
6363

6464
# ![5-test_cloned_repo_object]
6565

6666
# [6-test_cloned_repo_object]
67-
commits_for_file_generator=repo.iter_commits('--all',max_count=100,paths=file)
67+
commits_for_file_generator=repo.iter_commits(all=True,max_count=10,paths=file)
6868
commits_for_file= [cforcincommits_for_file_generator]
6969
commits_for_file
7070

@@ -95,7 +95,8 @@ def test_cloned_repo_object(self, local_dir):
9595
# ![9-test_cloned_repo_object]
9696

9797
# [10-test_cloned_repo_object]
98-
repo.index.diff(None)
98+
repo.index.diff(None)# compares staging area to working directory
99+
repo.index.diff(repo.head.commit)# compares staging area to last commit
99100
# Output: [<git.diff.Diff object at 0x7fb66c076e50>,
100101
# <git.diff.Diff object at 0x7fb66c076ca0>]
101102
# ![10-test_cloned_repo_object]
@@ -118,7 +119,7 @@ def test_cloned_repo_object(self, local_dir):
118119

119120
# Previous commit tree
120121
# [13-test_cloned_repo_object]
121-
prev_commits= [cforcinrepo.iter_commits('--all',max_count=10)]
122+
prev_commits= [cforcinrepo.iter_commits(all=True,max_count=10)]# last 10 commits from all branches
122123
tree=prev_commits[0].tree
123124
# ![13-test_cloned_repo_object]
124125

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp