Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nickbroon/python-gitlab
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: python-gitlab/python-gitlab
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jan 20, 2026

  1. fix: file save start_branch as a body attribute

    Passing `start_branch` as kwargs results in it being passed as query
    argument to the API:
    
    ```
    send: b'PUT /api/v4/projects/12345678/repository/files/readme.txt?start_branch=main
    
    send: b'{"file_path": "readme.txt", "branch": "new_branch", "content":
    "Modified contents", "commit_message": "File was modified for this new
    branch"}'
    ```
    
    which results in error being returned:
    
    ```
    {"message":"You can only create or edit files when you are on a branch"}
    ```
    
    It should instead be sent a body attribute, which succeeds in creating
    the branch during the save.
    
    To be sent as body attribute it must be specified as concrete function
    argument and class attribute instead of just using kwargs
    
    Closes: python-gitlab#3318
    nickbroon authored and JohnVillalovos committed Jan 20, 2026
    Configuration menu
    Copy the full SHA
    1001d93 View commit details
    Browse the repository at this point in the history
  2. fix: actually define project repr_attr

    While `_repr_attr=` is given to specify the attribute to use to repr the
    object, that object attribute itself is not actually defined, so tools
    like PyRight/MyPy complain that:
    
    ```
    Type of "path_with_namespace" is unknown
    ```
    nickbroon authored and JohnVillalovos committed Jan 20, 2026
    Configuration menu
    Copy the full SHA
    4187a69 View commit details
    Browse the repository at this point in the history
Loading