Hi,
I'm trying to alter an existing file on bitbucket using this rest call:
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-src-post
But whenever I change a file which has a +x modifier, it loses it after I run the post command. The file change however does still go through. So I always get a 201 response.
So after the change, I checkout the branch to verify and I get the following result:
diff --git a/ci/build.sh b/ci/build.sh
old mode 100755
new mode 100644
I tried it with and without Content-Disposition, but it neither seem to work.
This is my last attempt:
```
```
Also doing something along the lines of this doesn't seem to work either:
```
url = f"https://api.bitbucket.org/2.0/repositories/{WORKSPACE}/{REPO_SLUG}/src"
m = MultipartEncoder(
fields={
"message": "Add shutdown script + symlink",
"branch": BRANCH,
# destination paths in the repo:
"bin/shutdown.sh": part(
"bin/shutdown.sh",
"shutdown.sh",
b"#!/bin/sh\nhalt\n",
"executable",
),
"README.txt": part(
"README.txt",
"README.txt",
b"README\n", # symlink target path :contentReference[oaicite:3]{index=3}
"link",
),
}
)
resp = requests.post(
url,
data=m,
headers={"Authorization": f"Bearer {ACCESS_TOKEN}", "Content-Type": m.content_type},
timeout=30,
)
```
Any help with some concrete examples would be appreciated.