38 lines
703 B
TypeScript
38 lines
703 B
TypeScript
export enum TipState {
|
|
Unknown,
|
|
Unborn,
|
|
Detached,
|
|
Valid,
|
|
}
|
|
|
|
export interface IUnknownRepository {
|
|
readonly kind: TipState.Unknown;
|
|
}
|
|
|
|
export interface IUnbornRepository {
|
|
readonly kind: TipState.Unborn;
|
|
|
|
/**
|
|
* The symbolic reference that the unborn repository points to currently.
|
|
*
|
|
* Typically this will be "master" but a user can easily create orphaned
|
|
* branches externally.
|
|
*/
|
|
readonly ref: string;
|
|
}
|
|
|
|
export interface IDetachedHead {
|
|
readonly kind: TipState.Detached;
|
|
/**
|
|
* The commit identifier of the current tip of the repository.
|
|
*/
|
|
readonly currentSha: string;
|
|
}
|
|
|
|
|
|
export type Tip =
|
|
| IUnknownRepository
|
|
| IUnbornRepository
|
|
| IDetachedHead
|
|
;
|