Local git client does not produce correct diff output
While reviewing #49 I noticed that the local git client isn't working right. I did a silly debug patch to see what it actually generates as diff_content:
diff --git a/src/ai_code_review/core/local_git_client.py b/src/ai_code_review/core/local_git_client.py
index f990020..e73b477 100644
--- a/src/ai_code_review/core/local_git_client.py
+++ b/src/ai_code_review/core/local_git_client.py
@@ -251,6 +251,8 @@ class LocalGitClient(BasePlatformClient):
diff_content = await asyncio.to_thread(
self._get_diff_content, diff_item
)
+ print("XXX")
+ print(diff_content)
# Skip binary files or files without diffs
if not diff_content or diff_content.strip() == "":
and the result is:
XXX
.ai_review/config.yml.example
=======================================================
lhs: 100644 | b3817c34ccb7dc18484bfb22ea5e011f75a02250
rhs: 100644 | 433ca739923aab51f9d172a0d022041ce5075e01
XXX
README.md
=======================================================
lhs: 100644 | ebdc2b3cba507696363e9af1a6ab1f8e766dcbca
rhs: 100644 | b60077cfd103f0b8b865d72f9ad1d3f8765098d6
XXX
docs/developer-guide.md
=======================================================
lhs: 100644 | ac0706434a589fdfd631110a2978620923a89e89
rhs: 100644 | b59374237d7d2c8bb9067ecf7e30b5ee3e472f53
XXX
docs/user-guide.md
=======================================================
lhs: 100644 | 5d9a43cb2939f90ddb2b6a50b5dc3885b03dd93c
rhs: 100644 | 2d7dce1ff51edb26ae733055dc58ee0d737200a7
XXX
env.example
=======================================================
lhs: 100644 | b33f61158eb0e155dc1b3d2bafc5ddbb58023dd0
rhs: 100644 | ab647a17a6cd5b62c4a583def4bf584d4e2e106e
XXX
pyproject.toml
=======================================================
lhs: 100644 | e9dae5ed53705fce36ab1db177b708ade273845b
rhs: 100644 | 01d3e906c1bd89d7fb422f6e01391ae2023a26af
XXX
src/ai_code_review/cli.py
=======================================================
lhs: 100644 | 182717195d70a3936e2914c3960a70e5b65de854
rhs: 100644 | e21932797f92112f38a19973f24aa3a9d34de3e5
XXX
src/ai_code_review/core/forgejo_client.py
=======================================================
lhs: None
rhs: 100644 | f41d82cf0cf02b720ebd7ac77d838c4b5ebddcfb
file added in rhs
XXX
src/ai_code_review/core/review_engine.py
=======================================================
lhs: 100644 | 4cab4b2ccfb6e5025104cfad2fc06a576396fad5
rhs: 100644 | 6b57e1d1d115c6c6368c42367c543708c7d36e70
XXX
src/ai_code_review/models/config.py
=======================================================
lhs: 100644 | 301ce46fa26a713d9ce940389eb2bbcad9f68566
rhs: 100644 | 09796c54e8269acb438024e7e9dbfd21b026641d
XXX
src/ai_code_review/utils/platform_exceptions.py
=======================================================
lhs: 100644 | afc5e7ee558fd880d9a8ff35af914877964e98b0
rhs: 100644 | 0a7f471a2d1e7b0ea46a242cba6790ee8be724ce
XXX
tests/unit/test_ai_code_review_forgejo_client.py
=======================================================
lhs: None
rhs: 100644 | 3b0c4580ee9f71d3ddf7b225f4a13f3bb4e0c039
file added in rhs
XXX
uv.lock
=======================================================
lhs: 100644 | 249167a3066f17a9412209dd342457e91904def1
rhs: 100644 | 1735d69d4efa0e9e121cdc84e4b1a020beceda7d
that is, it's not actually giving the changed file contents at all, just filenames and hashes. So that means the review doesn't have any actual change content to review.
We can probably fix this by using repo.git.diff...somehow...