atlassian / atlassian/atlascode

[Bitbucket DC]: Some PRs diff doesn't display original file

Open
#360 1 comment 0 reactions 0 assignees View on GitHub
bitbucket DC
Dominant language
TypeScript
Stars
129
Forks
82
Avg merge
3h 3m
Merged PRs (30d)
6

Description

**Describe the bug**
Assumption that the main repository is named `zzz`, and the contributor's fork is named `zzz_fork`. Our main branch is called `xx-dev`.
If the source branch of a Pull Request is also named xx-dev (i.e., `zzz_fork/xx-dev` → `zzz/xx-dev`), the diff correctly shows the modified content. Otherwise (i.e., `zzz_fork/xx-compile` → `zzz/xx-dev`),, the diff only displays the entire modified file instead of the specific changes.

**To Reproduce**
1. Open a PR where the source branch name in the fork repository does not match the target branch name in the forked repository.

**Expected behavior**
The diff should clearly show the original version of the file along with the modified sections.

**Screenshots**
- PR that diff doesn't work in plugin
![Image](https://github.com/user-attachments/assets/c95f884b-cd75-431f-9243-845d38642ab7)
![Image](https://github.com/user-attachments/assets/d8aa3eb2-ca00-424f-b072-affd50a3872a)
![Image](https://github.com/user-attachments/assets/4e0f2d19-fbb6-4efd-9f66-dd88ba749742)
- The same PR in web browser
![Image](https://github.com/user-attachments/assets/a7fde6d2-dff5-4b29-a975-7b38d4451037)
- Error in git output
![Image](https://github.com/user-attachments/assets/c8b59080-8da9-416a-aeaa-f917327ca4cc)

- PR that diff works in plugin
![Image](https://github.com/user-attachments/assets/1481c1ef-82e8-4b5b-8be3-4bba8c1aa46b)
![Image](https://github.com/user-attachments/assets/0b23ad49-1b48-4404-8419-58e901d24f90)

**Environment and Version (please complete the following information):**
- Atlassian Plugin Version (3.6.0/3.4.17/3.4.20)
- Visual Studio Code Version (1.98.0)
Commit: 6609ac3d66f4eade5cf376d1cb76f13985724bcb
Date: 2025-03-04T21:06:18.612Z
Electron: 34.2.0
ElectronBuildId: 11044223
Chromium: 132.0.6834.196
Node.js: 20.18.2
V8: 13.2.152.36-electron.0
OS: Windows_NT x64 10.0.22621
- Is this a local or cloud environment? (Local)
- OS (linux)

**Additional context**
I have tried the plugin in version 3.6.0/3.4.17/3.4.20 but their behavior was consistent.

Contributor guide

Open the contributing guide

Research direction

Reproduce the pull request diff with matching and non-matching source and target branch names, then inspect the reported Git output and error. Trace the TypeScript pull request diff flow from that failure; done means the original file and only its changed sections are displayed for forked branches with different names.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, typescript
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.