MCPcopy Create free account
hub / github.com/dagger/dagger / GitRef

Class GitRef

sdk/python/src/dagger/client/gen.py:9475–9593  ·  view source on GitHub ↗

A git ref (tag, branch, or commit).

Source from the content-addressed store, hash-verified

9473
9474@typecheck
9475class GitRef(Type):
9476 """A git ref (tag, branch, or commit)."""
9477
9478 async def commit(self) -> str:
9479 """The resolved commit id at this ref.
9480
9481 Returns
9482 -------
9483 str
9484 The `String` scalar type represents textual data, represented as
9485 UTF-8 character sequences. The String type is most often used by
9486 GraphQL to represent free-form human-readable text.
9487
9488 Raises
9489 ------
9490 ExecuteTimeoutError
9491 If the time to execute the query exceeds the configured timeout.
9492 QueryError
9493 If the API returns an error.
9494 """
9495 _args: list[Arg] = []
9496 _ctx = self._select("commit", _args)
9497 return await _ctx.execute(str)
9498
9499 def common_ancestor(self, other: Self) -> Self:
9500 """Find the best common ancestor between this ref and another ref.
9501
9502 Parameters
9503 ----------
9504 other:
9505 The other ref to compare against.
9506 """
9507 _args = [
9508 Arg("other", other),
9509 ]
9510 _ctx = self._select("commonAncestor", _args)
9511 return GitRef(_ctx)
9512
9513 async def id(self) -> str:
9514 """A unique identifier for this GitRef.
9515
9516 Note
9517 ----
9518 This is lazily evaluated, no operation is actually run.
9519
9520 Returns
9521 -------
9522 str
9523 The `ID` scalar type represents a unique identifier, often used to
9524 refetch an object or as key for a cache. The ID type appears in a
9525 JSON response as a String; however, it is not intended to be
9526 human-readable. When expected as an input type, any string (such
9527 as `"4"`) or integer (such as `4`) input value will be accepted as
9528 an ID.
9529
9530 Raises
9531 ------
9532 ExecuteTimeoutError

Callers 10

git_refMethod · 0.70
as_git_refMethod · 0.70
common_ancestorMethod · 0.70
branchMethod · 0.70
commitMethod · 0.70
headMethod · 0.70
latest_versionMethod · 0.70
refMethod · 0.70
tagMethod · 0.70
load_git_ref_from_idMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected