0

We have some files to maintain on gitlab which will be committed by the user from ui for web application. For this we are using "Create a commit with multiple files and actions" api. But we are facing issue (i.e. getting unrelated commits of other files also.) while fetching commits list for a file on same branch using "List repository commits" api.

example for post api to upload multiple files on gitlab: https://gitlab.com/api/v4/projects/80982357/repository/commits?PRIVATE_TOKEN=jfhjdudhjurytrteygf

body : { "branch": "main", "commit_message": "to check commits-12", "actions": [ { "action": "create", "file_path": "folder1/folder2/file-1", "content": "some content" } , { "action": "update", "file_path": "folder1/folder2/file-2", "content": "some content-2" } }

example for get api to fetch all commits: https://gitlab.com/api/v4/projects/80982357/repository/commits?ref_name=main&PRIVATE_TOKEN=jfhjdudhjurytrteygf&path=folder1/folder2/file-1

steps to reproduce

  1. create a project
  2. upload few files to gitlab using "Create a commit with multiple files and actions" api .
  3. repeat step 2.
  4. upload a new file, and update a file using same api as above.
  5. try to get commits list of newly added file (as per point 4) using "List repository commits".

expected behaviour only specific commits which belongs to that file should come in commits list.

actual behaviour all commits (unrelated) are coming in commits list.

Payal
  • 11
  • 3

0 Answers0