Documentation
¶
Index ¶
- Constants
- func SeparateLines(fragment *gitdiff.TextFragment) ([]SplitLine, []SplitLine)
- type AncestorCheckResponse
- type Branch
- type Capabilities
- type ConflictInfo
- type Diff
- type DiffOpts
- type DiffStat
- type DiffTree
- type ForkInfo
- type ForkStatus
- type FormatPatch
- type LastCommitInfo
- type MergeCheckResponse
- type MergeRequest
- type NiceDiff
- type NiceTree
- type Reference
- type RepoBlobResponse
- type RepoBranchResponse
- type RepoBranchesResponse
- type RepoCommitResponse
- type RepoDefaultBranchResponse
- type RepoFormatPatchResponse
- type RepoIndexResponse
- type RepoLanguageDetails
- type RepoLanguageResponse
- type RepoLogResponse
- type RepoTagsResponse
- type RepoTreeResponse
- type SplitDiff
- type SplitFragment
- type SplitLine
- type TagReference
- type TextFragment
Constants ¶
View Source
const ( UpToDate ForkStatus = 0 FastForwardable = 1 Conflict = 2 MissingBranch = 3 )
Variables ¶
This section is empty.
Functions ¶
func SeparateLines ¶
func SeparateLines(fragment *gitdiff.TextFragment) ([]SplitLine, []SplitLine)
separate lines into left and right, this includes additional logic to group consecutive runs of additions and deletions in order to align them properly in the final output
TODO: move all diff stuff to a single package, we are spread across patchutil and types right now
Types ¶
type AncestorCheckResponse ¶
type AncestorCheckResponse struct {
Status ForkStatus `json:"status"`
}
type Branch ¶
type Capabilities ¶
type ConflictInfo ¶
type Diff ¶
type Diff struct {
Name struct {
Old string `json:"old"`
New string `json:"new"`
} `json:"name"`
TextFragments []gitdiff.TextFragment `json:"text_fragments"`
IsBinary bool `json:"is_binary"`
IsNew bool `json:"is_new"`
IsDelete bool `json:"is_delete"`
IsCopy bool `json:"is_copy"`
IsRename bool `json:"is_rename"`
}
type DiffTree ¶
type ForkInfo ¶
type ForkInfo struct {
IsFork bool
Status ForkStatus
}
type FormatPatch ¶
type FormatPatch struct {
Files []*gitdiff.File
*gitdiff.PatchHeader
Raw string
}
func (FormatPatch) ChangeId ¶
func (f FormatPatch) ChangeId() (string, error)
type LastCommitInfo ¶
type MergeCheckResponse ¶
type MergeCheckResponse struct {
IsConflicted bool `json:"is_conflicted"`
Conflicts []ConflictInfo `json:"conflicts"`
Message string `json:"message"`
Error string `json:"error"`
}
type MergeRequest ¶
type NiceDiff ¶
type NiceDiff struct {
Commit struct {
Message string `json:"message"`
Author object.Signature `json:"author"`
This string `json:"this"`
Parent string `json:"parent"`
PGPSignature string `json:"pgp_signature"`
Committer object.Signature `json:"committer"`
Tree string `json:"tree"`
ChangedId string `json:"change_id"`
} `json:"commit"`
Stat struct {
FilesChanged int `json:"files_changed"`
Insertions int `json:"insertions"`
Deletions int `json:"deletions"`
} `json:"stat"`
Diff []Diff `json:"diff"`
}
A nicer git diff representation.
type NiceTree ¶
type NiceTree struct {
// Relative path
Name string `json:"name"`
Mode string `json:"mode"`
Size int64 `json:"size"`
LastCommit *LastCommitInfo `json:"last_commit,omitempty"`
}
A nicer git tree representation.
type RepoBlobResponse ¶
type RepoBranchesResponse ¶
type RepoBranchesResponse struct {
Branches []Branch `json:"branches,omitempty"`
}
type RepoCommitResponse ¶
type RepoDefaultBranchResponse ¶
type RepoDefaultBranchResponse struct {
Branch string `json:"branch,omitempty"`
}
type RepoFormatPatchResponse ¶
type RepoFormatPatchResponse struct {
Rev1 string `json:"rev1,omitempty"`
Rev2 string `json:"rev2,omitempty"`
FormatPatch []FormatPatch `json:"format_patch,omitempty"`
FormatPatchRaw string `json:"patch,omitempty"`
CombinedPatch []*gitdiff.File `json:"combined_patch,omitempty"`
CombinedPatchRaw string `json:"combined_patch_raw,omitempty"`
}
type RepoIndexResponse ¶
type RepoIndexResponse struct {
IsEmpty bool `json:"is_empty"`
Ref string `json:"ref,omitempty"`
Readme string `json:"readme,omitempty"`
ReadmeFileName string `json:"readme_file_name,omitempty"`
Commits []*object.Commit `json:"commits,omitempty"`
Description string `json:"description,omitempty"`
Files []NiceTree `json:"files,omitempty"`
Branches []Branch `json:"branches,omitempty"`
Tags []*TagReference `json:"tags,omitempty"`
TotalCommits int `json:"total_commits,omitempty"`
}
type RepoLanguageDetails ¶
type RepoLanguageResponse ¶
type RepoLogResponse ¶
type RepoLogResponse struct {
Commits []*object.Commit `json:"commits,omitempty"`
Ref string `json:"ref,omitempty"`
Description string `json:"description,omitempty"`
Log bool `json:"log,omitempty"`
Total int `json:"total,omitempty"`
Page int `json:"page,omitempty"`
PerPage int `json:"per_page,omitempty"`
}
type RepoTagsResponse ¶
type RepoTagsResponse struct {
Tags []*TagReference `json:"tags,omitempty"`
}
type RepoTreeResponse ¶
type RepoTreeResponse struct {
Ref string `json:"ref,omitempty"`
Parent string `json:"parent,omitempty"`
Description string `json:"description,omitempty"`
DotDot string `json:"dotdot,omitempty"`
Files []NiceTree `json:"files,omitempty"`
ReadmeFileName string `json:"readme_filename,omitempty"`
Readme string `json:"readme_contents,omitempty"`
}
type SplitDiff ¶
type SplitDiff struct {
Name string `json:"name"`
TextFragments []SplitFragment `json:"fragments"`
}
type SplitFragment ¶
type SplitLine ¶
type TagReference ¶
Source Files
¶
- capabilities.go
- diff.go
- merge.go
- patch.go
- repo.go
- split.go
- tree.go
Click to show internal directories.
Click to hide internal directories.