# metab file://<ORIGIN> --api /api/source/status
exit: 0
--- stdout ---
api: /api/source/status
status: 200
{
  "subject": "git_revision",
  "generation": 1,
  "pin": "42382ea2303b733e1e21b4bd6ddb974ca4e775eb",
  "ref": "refs/remotes/origin/topic",
  "ref_name": "topic",
  "name": "origin",
  "origin": "<ORIGIN>",
  "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
  "borrows": null,
  "shallow": false,
  "refreshable": true,
  "latest": "42382ea2303b733e1e21b4bd6ddb974ca4e775eb",
  "ref_on_origin": true,
  "last_fetch_at": "2026-09-17T12:00:00Z",
  "last_outcome": {
    "operation": "acquire",
    "outcome": "succeeded",
    "at": "2026-09-17T12:00:00Z"
  },
  "refreshing": false,
  "stale": false,
  "pull_request": null,
  "selection_state": null,
  "selection_href": null
}
--- stderr ---
cloning <ORIGIN> into <HOME>
cloned <ORIGIN> in 0.0 s
# metab file://<ORIGIN> --api /api/source/refresh --data refresh.json
exit: 0
--- stdout ---
api: /api/source/refresh
status: 202
{
  "refresh": "started",
  "status": {
    "subject": "git_revision",
    "generation": 1,
    "pin": "42382ea2303b733e1e21b4bd6ddb974ca4e775eb",
    "ref": "refs/remotes/origin/topic",
    "ref_name": "topic",
    "name": "origin",
    "origin": "<ORIGIN>",
    "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
    "borrows": null,
    "shallow": false,
    "refreshable": true,
    "latest": "42382ea2303b733e1e21b4bd6ddb974ca4e775eb",
    "ref_on_origin": true,
    "last_fetch_at": "2026-09-17T12:00:00Z",
    "last_outcome": {
      "operation": "acquire",
      "outcome": "succeeded",
      "at": "2026-09-17T12:00:00Z"
    },
    "refreshing": true,
    "stale": false,
    "pull_request": null,
    "selection_state": null,
    "selection_href": null
  }
}
after: /api/source/status
status: 200
{
  "subject": "git_revision",
  "generation": 1,
  "pin": "42382ea2303b733e1e21b4bd6ddb974ca4e775eb",
  "ref": "refs/remotes/origin/topic",
  "ref_name": "topic",
  "name": "origin",
  "origin": "<ORIGIN>",
  "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
  "borrows": null,
  "shallow": false,
  "refreshable": true,
  "latest": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
  "ref_on_origin": true,
  "last_fetch_at": "2026-09-17T12:00:10Z",
  "last_outcome": {
    "operation": "refresh",
    "outcome": "succeeded",
    "at": "2026-09-17T12:00:10Z"
  },
  "refreshing": false,
  "stale": false,
  "pull_request": null,
  "selection_state": null,
  "selection_href": null
}
--- stderr ---
# metab file://<ORIGIN> --api /api/source/status
exit: 0
--- stdout ---
api: /api/source/status
status: 200
{
  "subject": "git_revision",
  "generation": 1,
  "pin": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
  "ref": "refs/remotes/origin/topic",
  "ref_name": "topic",
  "name": "origin",
  "origin": "<ORIGIN>",
  "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
  "borrows": null,
  "shallow": false,
  "refreshable": true,
  "latest": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
  "ref_on_origin": true,
  "last_fetch_at": "2026-09-17T12:00:10Z",
  "last_outcome": {
    "operation": "refresh",
    "outcome": "succeeded",
    "at": "2026-09-17T12:00:10Z"
  },
  "refreshing": false,
  "stale": false,
  "pull_request": null,
  "selection_state": null,
  "selection_href": null
}
--- stderr ---
# metab file://<ORIGIN> --api /api/source/refresh --data commit-fetch.json
exit: 0
--- stdout ---
api: /api/source/refresh
status: 200
{
  "refresh": "fresh",
  "pull_refresh": null,
  "status": {
    "subject": "git_revision",
    "generation": 1,
    "pin": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
    "ref": "refs/remotes/origin/topic",
    "ref_name": "topic",
    "name": "origin",
    "origin": "<ORIGIN>",
    "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
    "borrows": null,
    "shallow": false,
    "refreshable": true,
    "latest": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
    "ref_on_origin": true,
    "last_fetch_at": "2026-09-17T12:00:10Z",
    "last_outcome": {
      "operation": "refresh",
      "outcome": "succeeded",
      "at": "2026-09-17T12:00:10Z"
    },
    "refreshing": false,
    "stale": false,
    "pull_request": null,
    "selection_state": null,
    "selection_href": null
  }
}
--- stderr ---
# metab file://<ORIGIN> --api /api/source/refresh --data commit-retry.json
exit: 0
--- stdout ---
api: /api/source/refresh
status: 202
{
  "refresh": "started",
  "pull_refresh": null,
  "status": {
    "subject": "git_revision",
    "generation": 1,
    "pin": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
    "ref": "refs/remotes/origin/topic",
    "ref_name": "topic",
    "name": "origin",
    "origin": "<ORIGIN>",
    "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
    "borrows": null,
    "shallow": false,
    "refreshable": true,
    "latest": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
    "ref_on_origin": true,
    "last_fetch_at": "2026-09-17T12:00:10Z",
    "last_outcome": {
      "operation": "refresh",
      "outcome": "succeeded",
      "at": "2026-09-17T12:00:10Z"
    },
    "refreshing": true,
    "stale": false,
    "pull_request": null,
    "selection_state": null,
    "selection_href": null
  }
}
after: /api/source/status
status: 200
{
  "subject": "git_revision",
  "generation": 1,
  "pin": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
  "ref": "refs/remotes/origin/topic",
  "ref_name": "topic",
  "name": "origin",
  "origin": "<ORIGIN>",
  "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
  "borrows": null,
  "shallow": false,
  "refreshable": true,
  "latest": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
  "ref_on_origin": true,
  "last_fetch_at": "2026-09-17T12:00:20Z",
  "last_outcome": {
    "operation": "refresh",
    "outcome": "succeeded",
    "at": "2026-09-17T12:00:20Z"
  },
  "refreshing": false,
  "stale": false,
  "pull_request": null,
  "selection_state": null,
  "selection_href": null
}
--- stderr ---
# metab file://<ORIGIN> --api /api/source/pin --data pin-second.json
exit: 0
--- stdout ---
api: /api/source/pin
status: 200
{
  "changed": true,
  "status": {
    "subject": "git_revision",
    "generation": 2,
    "pin": "42382ea2303b733e1e21b4bd6ddb974ca4e775eb",
    "ref": null,
    "ref_name": null,
    "name": "origin",
    "origin": "<ORIGIN>",
    "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
    "borrows": null,
    "shallow": false,
    "refreshable": true,
    "latest": null,
    "ref_on_origin": null,
    "last_fetch_at": "2026-09-17T12:00:20Z",
    "last_outcome": {
      "operation": "refresh",
      "outcome": "succeeded",
      "at": "2026-09-17T12:00:20Z"
    },
    "refreshing": false,
    "stale": false,
    "pull_request": null,
    "selection_state": null,
    "selection_href": null
  }
}
--- stderr ---
# metab file://<ORIGIN> --api /api/source/pin --data pin-v2.json
exit: 0
--- stdout ---
api: /api/source/pin
status: 200
{
  "changed": true,
  "status": {
    "subject": "git_revision",
    "generation": 2,
    "pin": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
    "ref": "refs/tags/v2",
    "ref_name": "v2",
    "name": "origin",
    "origin": "<ORIGIN>",
    "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
    "borrows": null,
    "shallow": false,
    "refreshable": true,
    "latest": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
    "ref_on_origin": true,
    "last_fetch_at": "2026-09-17T12:00:20Z",
    "last_outcome": {
      "operation": "refresh",
      "outcome": "succeeded",
      "at": "2026-09-17T12:00:20Z"
    },
    "refreshing": false,
    "stale": false,
    "pull_request": null,
    "selection_state": null,
    "selection_href": null
  }
}
--- stderr ---
# metab file://<ORIGIN> --api /api/source/pin --data pin-feature.json
exit: 1
--- stdout ---
api: /api/source/pin
status: 404
{
  "error": "no branch or tag with that name is in the mirror",
  "code": "selection_not_found"
}
--- stderr ---
Error: /api/source/pin returned HTTP 404
# metab file://<ORIGIN> --api /api/source/pin --data pin-feature-oid.json
exit: 0
--- stdout ---
api: /api/source/pin
status: 200
{
  "changed": true,
  "status": {
    "subject": "git_revision",
    "generation": 2,
    "pin": "c7ae2a331f546e6a2431ed7093e9e430a9d1269b",
    "ref": null,
    "ref_name": null,
    "name": "origin",
    "origin": "<ORIGIN>",
    "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
    "borrows": null,
    "shallow": false,
    "refreshable": true,
    "latest": null,
    "ref_on_origin": null,
    "last_fetch_at": "2026-09-17T12:00:20Z",
    "last_outcome": {
      "operation": "refresh",
      "outcome": "succeeded",
      "at": "2026-09-17T12:00:20Z"
    },
    "refreshing": false,
    "stale": false,
    "pull_request": null,
    "selection_state": null,
    "selection_href": null
  }
}
--- stderr ---
# metab file://<ORIGIN> --api /api/source/refresh --data refresh.json
exit: 1
--- stdout ---
api: /api/source/refresh
status: 202
{
  "refresh": "started",
  "status": {
    "subject": "git_revision",
    "generation": 1,
    "pin": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
    "ref": "refs/remotes/origin/topic",
    "ref_name": "topic",
    "name": "origin",
    "origin": "<ORIGIN>",
    "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
    "borrows": null,
    "shallow": false,
    "refreshable": true,
    "latest": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
    "ref_on_origin": true,
    "last_fetch_at": "2026-09-17T12:00:20Z",
    "last_outcome": {
      "operation": "refresh",
      "outcome": "succeeded",
      "at": "2026-09-17T12:00:20Z"
    },
    "refreshing": true,
    "stale": false,
    "pull_request": null,
    "selection_state": null,
    "selection_href": null
  }
}
after: /api/source/status
status: 200
{
  "subject": "git_revision",
  "generation": 1,
  "pin": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
  "ref": "refs/remotes/origin/topic",
  "ref_name": "topic",
  "name": "origin",
  "origin": "<ORIGIN>",
  "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
  "borrows": null,
  "shallow": false,
  "refreshable": true,
  "latest": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
  "ref_on_origin": true,
  "last_fetch_at": "2026-09-17T12:00:20Z",
  "last_outcome": {
    "operation": "refresh",
    "outcome": "origin_unavailable",
    "at": "2026-09-17T12:00:30Z"
  },
  "refreshing": false,
  "stale": false,
  "pull_request": null,
  "selection_state": null,
  "selection_href": null
}
--- stderr ---
Error: the refresh ended with origin_unavailable
# metab file://<ORIGIN> --api /api/source/status
exit: 0
--- stdout ---
api: /api/source/status
status: 200
{
  "subject": "git_revision",
  "generation": 1,
  "pin": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
  "ref": "refs/remotes/origin/topic",
  "ref_name": "topic",
  "name": "origin",
  "origin": "<ORIGIN>",
  "location": "<HOME>/repository-stores/<STORE_KEY>/repository.git",
  "borrows": null,
  "shallow": false,
  "refreshable": true,
  "latest": "79c734ab2c794b6aa3ea3186ef7d8a6578981721",
  "ref_on_origin": true,
  "last_fetch_at": "2026-09-17T12:00:20Z",
  "last_outcome": {
    "operation": "refresh",
    "outcome": "origin_unavailable",
    "at": "2026-09-17T12:00:30Z"
  },
  "refreshing": false,
  "stale": false,
  "pull_request": null,
  "selection_state": null,
  "selection_href": null
}
--- stderr ---
