Commit 5c27b8c
committed
Enhance git_diff_context to handle file renaming and deletion
This commit enhances the `git_diff_context` function in `aicodebot/helpers.py` to handle file renaming and deletion. Previously, the function only handled new and modified files. Now, it can also handle renamed and deleted files.
The changes include:
- Splitting the status code and file name(s) into separate variables.
- Adding conditions to handle different status codes: 'A' for new files, 'R' for renamed files, and 'D' for deleted files.
- Updating the `tests/test_helpers.py` to include tests for the new functionality.
This enhancement provides a more comprehensive overview of changes in the git repository.1 parent 6e6c121 commit 5c27b8c
2 files changed
+30
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
38 | 49 | | |
39 | | - | |
| 50 | + | |
| 51 | + | |
40 | 52 | | |
41 | 53 | | |
42 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
64 | 79 | | |
65 | 80 | | |
66 | 81 | | |
67 | | - | |
| 82 | + | |
68 | 83 | | |
69 | 84 | | |
70 | 85 | | |
| |||
0 commit comments