interactions:
- request:
    body: null
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-type:
      - application/json
      PRIVATE-TOKEN:
      - uggvSNQgEh7tjv7KbQis
      User-Agent:
      - python-gitlab/2.5.0
    method: GET
    uri: http://127.0.0.1:3000/api/v4/projects/test%2Ftest_rename_branches
  response:
    body:
      string: '{"id":16,"description":"","name":"Test Rename Branches","name_with_namespace":"test
        / Test Rename Branches","path":"test_rename_branches","path_with_namespace":"test/test_rename_branches","created_at":"2020-12-17T16:41:16.009Z","default_branch":"master","tag_list":[],"ssh_url_to_repo":"ssh://mathieu@127.0.0.1:2222/test/test_rename_branches.git","http_url_to_repo":"http://127.0.0.1:3000/test/test_rename_branches.git","web_url":"http://127.0.0.1:3000/test/test_rename_branches","readme_url":"http://127.0.0.1:3000/test/test_rename_branches/-/blob/master/README.md","avatar_url":null,"forks_count":0,"star_count":0,"last_activity_at":"2020-12-17T16:41:16.009Z","namespace":{"id":54,"name":"test","path":"test","kind":"group","full_path":"test","parent_id":null,"avatar_url":null,"web_url":"http://127.0.0.1:3000/groups/test"},"_links":{"self":"http://127.0.0.1:3000/api/v4/projects/16","issues":"http://127.0.0.1:3000/api/v4/projects/16/issues","merge_requests":"http://127.0.0.1:3000/api/v4/projects/16/merge_requests","repo_branches":"http://127.0.0.1:3000/api/v4/projects/16/repository/branches","labels":"http://127.0.0.1:3000/api/v4/projects/16/labels","events":"http://127.0.0.1:3000/api/v4/projects/16/events","members":"http://127.0.0.1:3000/api/v4/projects/16/members"},"packages_enabled":true,"empty_repo":false,"archived":false,"visibility":"private","resolve_outdated_diff_discussions":false,"container_registry_enabled":true,"container_expiration_policy":{"cadence":"1d","enabled":false,"keep_n":10,"older_than":"90d","name_regex":".*","name_regex_keep":null,"next_run_at":"2020-12-18T16:41:16.367Z"},"issues_enabled":true,"merge_requests_enabled":true,"wiki_enabled":true,"jobs_enabled":true,"snippets_enabled":true,"service_desk_enabled":false,"service_desk_address":null,"can_create_merge_request_in":true,"issues_access_level":"enabled","repository_access_level":"enabled","merge_requests_access_level":"enabled","forking_access_level":"enabled","wiki_access_level":"enabled","builds_access_level":"enabled","snippets_access_level":"enabled","pages_access_level":"private","operations_access_level":"enabled","analytics_access_level":"enabled","emails_disabled":null,"shared_runners_enabled":true,"lfs_enabled":true,"creator_id":1,"import_status":"none","import_error":null,"open_issues_count":0,"runners_token":"V6v7bUxa4VtEVYNUSAmK","ci_default_git_depth":50,"ci_forward_deployment_enabled":true,"public_jobs":true,"build_git_strategy":"fetch","build_timeout":3600,"auto_cancel_pending_pipelines":"enabled","build_coverage_regex":null,"ci_config_path":null,"shared_with_groups":[],"only_allow_merge_if_pipeline_succeeds":false,"allow_merge_on_skipped_pipeline":null,"request_access_enabled":true,"only_allow_merge_if_all_discussions_are_resolved":false,"remove_source_branch_after_merge":true,"printing_merge_request_link_enabled":true,"merge_method":"merge","suggestion_commit_message":null,"auto_devops_enabled":true,"auto_devops_deploy_strategy":"continuous","autoclose_referenced_issues":true,"repository_storage":"default","requirements_enabled":null,"compliance_frameworks":[],"permissions":{"project_access":null,"group_access":{"access_level":50,"notification_level":3}}}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Type:
      - application/json
      Date:
      - Thu, 17 Dec 2020 20:55:22 GMT
      Etag:
      - W/"38f11fbc6eb83027f8dfd69475507dbe"
      Vary:
      - Origin
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Gitlab-Feature-Category:
      - projects
      X-Request-Id:
      - 01ESS7RQMTKAXRH9DT4VARH4T4
      X-Runtime:
      - '0.645756'
    status:
      code: 200
      message: OK
- request:
    body: null
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-type:
      - application/json
      PRIVATE-TOKEN:
      - uggvSNQgEh7tjv7KbQis
      User-Agent:
      - python-gitlab/2.5.0
    method: GET
    uri: http://127.0.0.1:3000/api/v4/projects/16/repository/branches
  response:
    body:
      string: '[{"name":"already_exists","commit":{"id":"99107bceb7ba7c7d8652ce80595d38d7136fea66","short_id":"99107bce","created_at":"2020-12-17T17:44:21.000+01:00","parent_ids":null,"title":"Branch2","message":"Branch2","author_name":"Mathieu
        Parent","author_email":"math.parent@gmail.com","authored_date":"2020-12-17T17:44:21.000+01:00","committer_name":"Mathieu
        Parent","committer_email":"math.parent@gmail.com","committed_date":"2020-12-17T17:44:21.000+01:00","web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/commit/99107bceb7ba7c7d8652ce80595d38d7136fea66"},"merged":false,"protected":false,"developers_can_push":false,"developers_can_merge":false,"can_push":true,"default":false,"web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/tree/already_exists"},{"name":"branch1","commit":{"id":"1544ad6a6b9f3a6391a07d88e31e64dc1baf2b32","short_id":"1544ad6a","created_at":"2020-12-17T17:44:05.000+01:00","parent_ids":null,"title":"Branch1","message":"Branch1","author_name":"Mathieu
        Parent","author_email":"math.parent@gmail.com","authored_date":"2020-12-17T17:44:05.000+01:00","committer_name":"Mathieu
        Parent","committer_email":"math.parent@gmail.com","committed_date":"2020-12-17T17:44:05.000+01:00","web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/commit/1544ad6a6b9f3a6391a07d88e31e64dc1baf2b32"},"merged":false,"protected":false,"developers_can_push":false,"developers_can_merge":false,"can_push":true,"default":false,"web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/tree/branch1"},{"name":"branch2","commit":{"id":"99107bceb7ba7c7d8652ce80595d38d7136fea66","short_id":"99107bce","created_at":"2020-12-17T17:44:21.000+01:00","parent_ids":null,"title":"Branch2","message":"Branch2","author_name":"Mathieu
        Parent","author_email":"math.parent@gmail.com","authored_date":"2020-12-17T17:44:21.000+01:00","committer_name":"Mathieu
        Parent","committer_email":"math.parent@gmail.com","committed_date":"2020-12-17T17:44:21.000+01:00","web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/commit/99107bceb7ba7c7d8652ce80595d38d7136fea66"},"merged":false,"protected":false,"developers_can_push":false,"developers_can_merge":false,"can_push":true,"default":false,"web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/tree/branch2"},{"name":"master","commit":{"id":"ae5c070588589a9046a89c47d3f9388b22d3d5c8","short_id":"ae5c0705","created_at":"2020-12-17T17:41:24.000+01:00","parent_ids":null,"title":"Initial
        commit","message":"Initial commit","author_name":"Administrator","author_email":"admin@example.com","authored_date":"2020-12-17T17:41:24.000+01:00","committer_name":"Administrator","committer_email":"admin@example.com","committed_date":"2020-12-17T17:41:24.000+01:00","web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/commit/ae5c070588589a9046a89c47d3f9388b22d3d5c8"},"merged":false,"protected":false,"developers_can_push":false,"developers_can_merge":false,"can_push":true,"default":true,"web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/tree/master"},{"name":"old_name","commit":{"id":"ae5c070588589a9046a89c47d3f9388b22d3d5c8","short_id":"ae5c0705","created_at":"2020-12-17T17:41:24.000+01:00","parent_ids":null,"title":"Initial
        commit","message":"Initial commit","author_name":"Administrator","author_email":"admin@example.com","authored_date":"2020-12-17T17:41:24.000+01:00","committer_name":"Administrator","committer_email":"admin@example.com","committed_date":"2020-12-17T17:41:24.000+01:00","web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/commit/ae5c070588589a9046a89c47d3f9388b22d3d5c8"},"merged":false,"protected":false,"developers_can_push":false,"developers_can_merge":false,"can_push":true,"default":false,"web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/tree/old_name"}]'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Type:
      - application/json
      Date:
      - Thu, 17 Dec 2020 20:55:23 GMT
      Etag:
      - W/"cf52b264377076ddc0d1f3768cc53994"
      Link:
      - <http://127.0.0.1:3000/api/v4/projects/16/repository/branches?id=16&page=2&per_page=20>;
        rel="next", <http://127.0.0.1:3000/api/v4/projects/16/repository/branches?id=16&page=1&per_page=20>;
        rel="first", <http://127.0.0.1:3000/api/v4/projects/16/repository/branches?id=16&page=1&per_page=20>;
        rel="last"
      Vary:
      - Origin
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Gitlab-Feature-Category:
      - source_code_management
      X-Next-Page:
      - '2'
      X-Page:
      - '1'
      X-Per-Page:
      - '20'
      X-Prev-Page:
      - ''
      X-Request-Id:
      - 01ESS7RR9Z9DY4DK1ZK59JACZV
      X-Runtime:
      - '0.305778'
      X-Total:
      - '5'
      X-Total-Pages:
      - '1'
    status:
      code: 200
      message: OK
- request:
    body: null
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-type:
      - application/json
      PRIVATE-TOKEN:
      - uggvSNQgEh7tjv7KbQis
      User-Agent:
      - python-gitlab/2.5.0
    method: GET
    uri: http://127.0.0.1:3000/api/v4/projects/16/repository/branches?id=16&page=2&per_page=20
  response:
    body:
      string: '[]'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Length:
      - '2'
      Content-Type:
      - application/json
      Date:
      - Thu, 17 Dec 2020 20:55:23 GMT
      Etag:
      - W/"4f53cda18c2baa0c0354bb5f9a3ecbe5"
      Link:
      - <http://127.0.0.1:3000/api/v4/projects/16/repository/branches?id=16&page=1&per_page=20>;
        rel="first", <http://127.0.0.1:3000/api/v4/projects/16/repository/branches?id=16&page=1&per_page=20>;
        rel="last"
      Vary:
      - Origin
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Gitlab-Feature-Category:
      - source_code_management
      X-Next-Page:
      - ''
      X-Page:
      - '2'
      X-Per-Page:
      - '20'
      X-Prev-Page:
      - ''
      X-Request-Id:
      - 01ESS7RRMAKJ34KHX9046AWA70
      X-Runtime:
      - '0.798226'
      X-Total:
      - '5'
      X-Total-Pages:
      - '1'
    status:
      code: 200
      message: OK
- request:
    body: '{"branch": "new_name", "ref": "old_name"}'
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-Length:
      - '41'
      Content-type:
      - application/json
      PRIVATE-TOKEN:
      - uggvSNQgEh7tjv7KbQis
      User-Agent:
      - python-gitlab/2.5.0
    method: POST
    uri: http://127.0.0.1:3000/api/v4/projects/16/repository/branches
  response:
    body:
      string: '{"name":"new_name","commit":{"id":"ae5c070588589a9046a89c47d3f9388b22d3d5c8","short_id":"ae5c0705","created_at":"2020-12-17T17:41:24.000+01:00","parent_ids":[],"title":"Initial
        commit","message":"Initial commit","author_name":"Administrator","author_email":"admin@example.com","authored_date":"2020-12-17T17:41:24.000+01:00","committer_name":"Administrator","committer_email":"admin@example.com","committed_date":"2020-12-17T17:41:24.000+01:00","web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/commit/ae5c070588589a9046a89c47d3f9388b22d3d5c8"},"merged":false,"protected":false,"developers_can_push":false,"developers_can_merge":false,"can_push":true,"default":false,"web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/tree/new_name"}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Length:
      - '754'
      Content-Type:
      - application/json
      Date:
      - Thu, 17 Dec 2020 21:00:53 GMT
      Etag:
      - W/"a60a835def9a38d9426b06936921cbfa"
      Vary:
      - Origin
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Gitlab-Feature-Category:
      - source_code_management
      X-Request-Id:
      - 01ESS82R6WJG19P90452GT72C1
      X-Runtime:
      - '2.672466'
    status:
      code: 201
      message: Created
- request:
    body: null
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-Length:
      - '0'
      Content-type:
      - application/json
      PRIVATE-TOKEN:
      - uggvSNQgEh7tjv7KbQis
      User-Agent:
      - python-gitlab/2.5.0
    method: DELETE
    uri: http://127.0.0.1:3000/api/v4/projects/16/repository/branches/old_name
  response:
    body:
      string: ''
    headers:
      Cache-Control:
      - no-cache
      Content-Type:
      - application/json
      Date:
      - Thu, 17 Dec 2020 21:00:54 GMT
      Vary:
      - Origin
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Gitlab-Feature-Category:
      - source_code_management
      X-Request-Id:
      - 01ESS82V5KWSHGYGY9KJC710FH
      X-Runtime:
      - '1.304798'
    status:
      code: 204
      message: No Content
- request:
    body: '{"branch": "branch3", "ref": "branch2"}'
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-Length:
      - '39'
      Content-type:
      - application/json
      PRIVATE-TOKEN:
      - uggvSNQgEh7tjv7KbQis
      User-Agent:
      - python-gitlab/2.5.0
    method: POST
    uri: http://127.0.0.1:3000/api/v4/projects/16/repository/branches
  response:
    body:
      string: '{"name":"branch3","commit":{"id":"99107bceb7ba7c7d8652ce80595d38d7136fea66","short_id":"99107bce","created_at":"2020-12-17T17:44:21.000+01:00","parent_ids":["1544ad6a6b9f3a6391a07d88e31e64dc1baf2b32"],"title":"Branch2","message":"Branch2\n","author_name":"Mathieu
        Parent","author_email":"math.parent@gmail.com","authored_date":"2020-12-17T17:44:21.000+01:00","committer_name":"Mathieu
        Parent","committer_email":"math.parent@gmail.com","committed_date":"2020-12-17T17:44:21.000+01:00","web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/commit/99107bceb7ba7c7d8652ce80595d38d7136fea66"},"merged":false,"protected":false,"developers_can_push":false,"developers_can_merge":false,"can_push":true,"default":false,"web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/tree/branch3"}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Length:
      - '792'
      Content-Type:
      - application/json
      Date:
      - Thu, 17 Dec 2020 21:00:55 GMT
      Etag:
      - W/"92b3d19098222b98f7d23dc5c875bbb9"
      Vary:
      - Origin
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Gitlab-Feature-Category:
      - source_code_management
      X-Request-Id:
      - 01ESS82WF9F4DBQ1ZA6NMEA36J
      X-Runtime:
      - '0.943445'
    status:
      code: 201
      message: Created
- request:
    body: null
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-Length:
      - '0'
      Content-type:
      - application/json
      PRIVATE-TOKEN:
      - uggvSNQgEh7tjv7KbQis
      User-Agent:
      - python-gitlab/2.5.0
    method: DELETE
    uri: http://127.0.0.1:3000/api/v4/projects/16/repository/branches/branch2
  response:
    body:
      string: ''
    headers:
      Cache-Control:
      - no-cache
      Content-Type:
      - application/json
      Date:
      - Thu, 17 Dec 2020 21:00:56 GMT
      Vary:
      - Origin
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Gitlab-Feature-Category:
      - source_code_management
      X-Request-Id:
      - 01ESS82XDSN0Z46F5Y5QMZSVHR
      X-Runtime:
      - '0.967873'
    status:
      code: 204
      message: No Content
- request:
    body: '{"branch": "branch2", "ref": "branch1"}'
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-Length:
      - '39'
      Content-type:
      - application/json
      PRIVATE-TOKEN:
      - uggvSNQgEh7tjv7KbQis
      User-Agent:
      - python-gitlab/2.5.0
    method: POST
    uri: http://127.0.0.1:3000/api/v4/projects/16/repository/branches
  response:
    body:
      string: '{"name":"branch2","commit":{"id":"1544ad6a6b9f3a6391a07d88e31e64dc1baf2b32","short_id":"1544ad6a","created_at":"2020-12-17T17:44:05.000+01:00","parent_ids":["4843610f7365b00c5a02445940999ae88db8f9c7"],"title":"Branch1","message":"Branch1\n","author_name":"Mathieu
        Parent","author_email":"math.parent@gmail.com","authored_date":"2020-12-17T17:44:05.000+01:00","committer_name":"Mathieu
        Parent","committer_email":"math.parent@gmail.com","committed_date":"2020-12-17T17:44:05.000+01:00","web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/commit/1544ad6a6b9f3a6391a07d88e31e64dc1baf2b32"},"merged":false,"protected":false,"developers_can_push":false,"developers_can_merge":false,"can_push":true,"default":false,"web_url":"http://127.0.0.1:3000/test/test_rename_branches/-/tree/branch2"}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Length:
      - '792'
      Content-Type:
      - application/json
      Date:
      - Thu, 17 Dec 2020 21:00:57 GMT
      Etag:
      - W/"f2b71c026ac0e3094b7763ec15a252d9"
      Vary:
      - Origin
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Gitlab-Feature-Category:
      - source_code_management
      X-Request-Id:
      - 01ESS82YD6XY0E42JHB7N8GEX8
      X-Runtime:
      - '0.957839'
    status:
      code: 201
      message: Created
- request:
    body: null
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-Length:
      - '0'
      Content-type:
      - application/json
      PRIVATE-TOKEN:
      - uggvSNQgEh7tjv7KbQis
      User-Agent:
      - python-gitlab/2.5.0
    method: DELETE
    uri: http://127.0.0.1:3000/api/v4/projects/16/repository/branches/branch1
  response:
    body:
      string: ''
    headers:
      Cache-Control:
      - no-cache
      Content-Type:
      - application/json
      Date:
      - Thu, 17 Dec 2020 21:00:58 GMT
      Vary:
      - Origin
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Gitlab-Feature-Category:
      - source_code_management
      X-Request-Id:
      - 01ESS82ZBVH4X48KWEA6HWGA1C
      X-Runtime:
      - '1.334013'
    status:
      code: 204
      message: No Content
version: 1
