C# Class GitScc.GitRepository

Inheritance: IDisposable
Show file Open project: jzoss/Git-Source-Control-Provider Class Usage Examples

Private Properties

Property Type Description
BuildChange GitScc.DataServices.Change
CreateBranchInfoFromBranch GitScc.GitBranchInfo
CreateCommit GitScc.DataServices.Commit
CreateGitFileEvent Task
DecodeGitEvents Task
DeleteBranch string
FileChangedEvent Task
FileExistsInGit bool
FileExistsInGit bool
FileExistsInRepo bool
FileIgnored bool
FireBranchChangedEvent void
FireCommitShaChangedEvent void
FireFileStatusUpdateEvent void
FireFilesChangedEvent void
GetBranchId string
GetCommitById GitScc.DataServices.Commit
GetCurrentChangedFiles GitFile>.Dictionary
GetCurrentFilesStatus List
GetFullPathForGitFiles List
GetLatestCommits List
GetLib2GitBranch Branch
GetRepository LibGit2Sharp.Repository
GitFileEventUpdate Task
GitRun string
HandleFileSystemChanged Task
HandleFileSystemChanged void
LoadHeadState void
SetBranchName void
TryGetRelativePath bool

Public Methods

Method Description
AddFile ( string filename ) : void
AddIgnoreItem ( string fileName ) : void
Blame ( string fileName ) : string
CheckOutBranch ( string branch, bool createNew = false ) : void
CheckOutFile ( string fileName ) : void
Checkout ( GitScc.GitBranchInfo info, bool force = false ) : GitActionResult
CheckoutAsync ( GitScc.GitBranchInfo info, bool force = false ) : Task>
Commit ( string message, bool amend = false, bool signoff = false ) : GitActionResult
CreateBranch ( string branchName, string commitish = "HEAD" ) : GitActionResult
CurrentCommitHasRefs ( ) : bool
Diff ( string fileName ) : string
DiffFile ( string fileName, string commitId1, string commitId2 ) : string
DisableRepositoryWatcher ( ) : void

Update status when some file change is detected in the .git dir

Dispose ( ) : void
EditIngoreFile ( ) : void
EnableRepositoryWatcher ( ) : void
GetBranchInfo ( bool includeRemote = true, bool includeLocal = true, bool forceReload = false ) : List
GetChangedFilesForCommit ( string commitIdSha ) : List
GetChanges ( string commitId1, string commitId2 ) : List
GetCommitsForFile ( string fileName ) : IEnumerable
GetCurrentChangeSet ( ) : Task>
GetFileStatus ( string fileName, bool forceRefresh = false ) : GitFileStatus
GetRevision ( string filename ) : string
GetUnmodifiedFileByAbsolutePath ( string filename, string sha = null ) : string
GetUnmodifiedFileByRelativePath ( string relativePath, string sha = null ) : string
GitRepository ( string directory ) : GitScc.DataServices
Init ( string folderName ) : string
Refresh ( ) : void
SetRemoteBranch ( GitScc.GitBranchInfo localBranch, string remoteName = "origin" ) : void
StageFile ( string fileName ) : void
UnStageFile ( string fileName ) : void
UndoFileChanges ( string filename ) : void

Private Methods

Method Description
BuildChange ( LibGit2Sharp.PatchEntryChanges change ) : Change
CreateBranchInfoFromBranch ( Branch branch ) : GitScc.GitBranchInfo
CreateCommit ( LibGit2Sharp commit ) : GitScc.DataServices.Commit
CreateGitFileEvent ( FileSystemEventArgs e ) : Task
DecodeGitEvents ( ) : Task
DeleteBranch ( string name ) : string
FileChangedEvent ( ) : Task
FileExistsInGit ( string fileName ) : bool
FileExistsInGit ( string directory, string fileName ) : bool
FileExistsInRepo ( string fileName ) : bool
FileIgnored ( string filepath ) : bool
FireBranchChangedEvent ( string name ) : void
FireCommitShaChangedEvent ( string name ) : void
FireFileStatusUpdateEvent ( List files ) : void
FireFilesChangedEvent ( List files ) : void
GetBranchId ( string name ) : string
GetCommitById ( string sha ) : GitScc.DataServices.Commit
GetCurrentChangedFiles ( bool retryAllowed = true, Repository repository = null ) : GitFile>.Dictionary
GetCurrentFilesStatus ( ) : List
GetFullPathForGitFiles ( List files ) : List
GetLatestCommits ( int commitCount ) : List
GetLib2GitBranch ( GitScc.GitBranchInfo info ) : Branch
GetRepository ( ) : Repository
GitFileEventUpdate ( ) : Task

This is not very dry.. but It seems to cause a bunch of issues opening repos so fast.

GitRun ( string cmd ) : string
HandleFileSystemChanged ( ) : Task
HandleFileSystemChanged ( object sender, FileSystemEventArgs e ) : void
LoadHeadState ( ) : void
SetBranchName ( bool supressEvent = false ) : void
TryGetRelativePath ( string fileName, string &relativePath ) : bool

Method Details

AddFile() public method

public AddFile ( string filename ) : void
filename string
return void

AddIgnoreItem() public method

public AddIgnoreItem ( string fileName ) : void
fileName string
return void

Blame() public method

public Blame ( string fileName ) : string
fileName string
return string

CheckOutBranch() public method

public CheckOutBranch ( string branch, bool createNew = false ) : void
branch string
createNew bool
return void

CheckOutFile() public method

public CheckOutFile ( string fileName ) : void
fileName string
return void

Checkout() public method

public Checkout ( GitScc.GitBranchInfo info, bool force = false ) : GitActionResult
info GitScc.GitBranchInfo
force bool
return GitActionResult

CheckoutAsync() public method

public CheckoutAsync ( GitScc.GitBranchInfo info, bool force = false ) : Task>
info GitScc.GitBranchInfo
force bool
return Task>

Commit() public method

public Commit ( string message, bool amend = false, bool signoff = false ) : GitActionResult
message string
amend bool
signoff bool
return GitActionResult

CreateBranch() public method

public CreateBranch ( string branchName, string commitish = "HEAD" ) : GitActionResult
branchName string
commitish string
return GitActionResult

CurrentCommitHasRefs() public method

public CurrentCommitHasRefs ( ) : bool
return bool

Diff() public method

public Diff ( string fileName ) : string
fileName string
return string

DiffFile() public method

public DiffFile ( string fileName, string commitId1, string commitId2 ) : string
fileName string
commitId1 string
commitId2 string
return string

DisableRepositoryWatcher() public method

Update status when some file change is detected in the .git dir
public DisableRepositoryWatcher ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

EditIngoreFile() public method

public EditIngoreFile ( ) : void
return void

EnableRepositoryWatcher() public method

public EnableRepositoryWatcher ( ) : void
return void

GetBranchInfo() public method

public GetBranchInfo ( bool includeRemote = true, bool includeLocal = true, bool forceReload = false ) : List
includeRemote bool
includeLocal bool
forceReload bool
return List

GetChangedFilesForCommit() public method

public GetChangedFilesForCommit ( string commitIdSha ) : List
commitIdSha string
return List

GetChanges() public method

public GetChanges ( string commitId1, string commitId2 ) : List
commitId1 string
commitId2 string
return List

GetCommitsForFile() public method

public GetCommitsForFile ( string fileName ) : IEnumerable
fileName string
return IEnumerable

GetCurrentChangeSet() public method

public GetCurrentChangeSet ( ) : Task>
return Task>

GetFileStatus() public method

public GetFileStatus ( string fileName, bool forceRefresh = false ) : GitFileStatus
fileName string
forceRefresh bool
return GitFileStatus

GetRevision() public method

public GetRevision ( string filename ) : string
filename string
return string

GetUnmodifiedFileByAbsolutePath() public method

public GetUnmodifiedFileByAbsolutePath ( string filename, string sha = null ) : string
filename string
sha string
return string

GetUnmodifiedFileByRelativePath() public method

public GetUnmodifiedFileByRelativePath ( string relativePath, string sha = null ) : string
relativePath string
sha string
return string

GitRepository() public method

public GitRepository ( string directory ) : GitScc.DataServices
directory string
return GitScc.DataServices

Init() public static method

public static Init ( string folderName ) : string
folderName string
return string

Refresh() public method

public Refresh ( ) : void
return void

SetRemoteBranch() public method

public SetRemoteBranch ( GitScc.GitBranchInfo localBranch, string remoteName = "origin" ) : void
localBranch GitScc.GitBranchInfo
remoteName string
return void

StageFile() public method

public StageFile ( string fileName ) : void
fileName string
return void

UnStageFile() public method

public UnStageFile ( string fileName ) : void
fileName string
return void

UndoFileChanges() public method

public UndoFileChanges ( string filename ) : void
filename string
return void