Getting incorrect return from get_commit_diffs()
還沒有人認領這個 Issue。
評估
研究方向
從 get_commit_diffs() 入口開始,將 Python 引數與 issue 中顯示的 REST 請求進行比較,尤其是基礎提交與目標提交描述元。重現此呼叫,並驗證回傳的 base_commit、target_commit 與 changes 是否與直接的 REST 回應一致;當 Python API 回傳預期的 diff 時即表示完成。
由索引模型根據 Issue 內容生成。
描述
I'm trying to get the diff between two commit, therefore using this API as,
ref_heads = git_client.get_refs(repository_id=REPOSITORY_ID, project=PROJECT_NAME, filter=target_branch)
master_commit_id = ref_heads.value[0].object_id
source_commit_id = pull_request.last_merge_source_commit.commit_id
base_version_descriptor = GitBaseVersionDescriptor(version_type='commit', version=master_commit_id)
target_version_descriptor = GitTargetVersionDescriptor(version_type='commit', version=source_commit_id)
commit_diffs = git_client.get_commit_diffs(repository_id=REPOSITORY_ID, project=PROJECT_NAME,
diff_common_commit=True,
base_version_descriptor=base_version_descriptor,
target_version_descriptor=target_version_descriptor)
while print the commit_diffs, having output as,
Diffs Response: {'additional_properties': {}, 'ahead_count': 0, 'all_changes_included': True, 'base_commit': 'b106b44eebeef93d5240f08dca8ceb0124ca4415', 'behind_count': 0, 'change_counts': {}, 'changes': [], 'common_commit': 'b106b44eebeef93d5240f08dca8ceb0124ca4415', 'target_commit': 'b106b44eebeef93d5240f08dca8ceb0124ca4415'}
whereas, using curl to set direct REST request, returns correct output.
"https://dev.azure.com/ORGANIZATION/project/_apis/git/repositories/a21206d3-9bdb-41c4-8b77-56f82360a311e/diffs/commits?baseVersionType=commit&baseVersion=b106b44eebeef93d5240f08dca8ceb0124ca4415&targetVersionType=commit&targetVersion=165c197e54d689e9910eb111b9c14e2516184dd8&api-version=6.0"
What is the correct way to use the get_commit_diff()? Or what I'm doing wrong?
- 主要語言
- Python
- 星號
- 684
- 分支
- 218
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
我們還沒有檢查這個專案的環境設定檔。先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/azure-devops-python-api 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 55/100
-
難度 5/5 一週以上 新手友好度 25/100
-
難度 1/5 1 小時以內 新手友好度 55/100
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 3/5 1-2 天 新手友好度 45/100
查看 microsoft/azure-devops-python-api 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
conda-forge/conda-build-feedstock#289 · 1 則留言 · 1 個 reaction ·
-
`pulptest` no longer works in 4.0.0: `ImportError: Start directory is not importable: 'pulp/tests'`未關閉
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 72/100
TomCasavant/ohio-sites#224 ·