Ejemplo n.º 1
0
 public static void Create(
     out IGitFunction <FormatMergeMessageParameters, string> function,
     ICommandExecutor commandExecutor)
 {
     function = new FormatMergeMessageImpl(commandExecutor);
 }
Ejemplo n.º 2
0
 public static void Create(
     out IGitFunction <QuerySymbolicReferenceParameters, SymbolicReferenceData> function,
     IGitRepository repository)
 {
     function = new QuerySymbolicReferenceImpl(repository);
 }
Ejemplo n.º 3
0
        public RepositoryCLI(GitCLI gitCLI, IGitRepository repository)
        {
            Verify.Argument.IsNotNull(gitCLI, nameof(gitCLI));
            Verify.Argument.IsNotNull(repository, nameof(repository));

            _gitCLI     = gitCLI;
            _repository = repository;
            _executor   = new RepositoryCommandExecutor(gitCLI, repository.WorkingDirectory);

            GitCliMethod.Create(out _addConfigValue, CommandExecutor, CommandBuilder.GetAddConfigValueCommand, OutputParser.HandleConfigResults);
            GitCliMethod.Create(out _addFiles, CommandExecutor, CommandBuilder.GetAddFilesCommand);
            GitCliMethod.Create(out _addRemote, CommandExecutor, CommandBuilder.GetAddRemoteCommand);
            GitCliMethod.Create(out _addSubmodule, CommandExecutor, CommandBuilder.GetAddSubmoduleCommand);
            GitCliMethod.Create(out _appendNote, CommandExecutor, CommandBuilder.GetAppendNoteCommand);
            GitCliMethod.Create(out _applyPatch, CommandExecutor, CommandBuilder.GetApplyPatchCommand);
            GitCliMethod.Create(out _archive, CommandExecutor, CommandBuilder.GetArchiveCommand);
            GitCliMethod.Create(out _cleanFiles, CommandExecutor, CommandBuilder.GetCleanFilesCommand);
            GitCliMethod.Create(out _checkout, CommandExecutor, CommandBuilder.GetCheckoutCommand, OutputParser.HandleCheckoutResult);
            GitCliMethod.Create(out _checkoutFiles, CommandExecutor, CommandBuilder.GetCheckoutFilesCommand);
            GitCliMethod.Create(out _cherryPick, CommandExecutor, CommandBuilder.GetCherryPickCommand, OutputParser.HandleCherryPickResult);
            GitCliMethod.Create(out _commit, CommandExecutor, CommandBuilder.GetCommitCommand, OutputParser.ParseCommitResult);
            GitCliMethod.Create(out _countObjects, CommandExecutor, CommandBuilder.GetCountObjectsCommand, OutputParser.ParseObjectCountData);
            GitCliMethod.Create(out _createBranch, CommandExecutor, CommandBuilder.GetCreateBranchCommand, OutputParser.HandleCreateBranchResult);
            GitCliMethod.Create(out _createTag, CommandExecutor, CommandBuilder.GetCreateTagCommand, OutputParser.HandleCreateTagResult);
            GitCliMethod.Create(out _deleteBranch, CommandExecutor, CommandBuilder.GetDeleteBranchCommand, OutputParser.HandleDeleteBranchResult);
            GitCliMethod.Create(out _deleteConfigSection, CommandExecutor, CommandBuilder.GetDeleteConfigSectionCommand, OutputParser.HandleConfigResults);
            GitCliMethod.Create(out _deleteTag, CommandExecutor, CommandBuilder.GetDeleteTagCommand, OutputParser.HandleDeleteTagResult);
            GitCliMethod.Create(out _dereference, CommandExecutor, CommandBuilder.GetDereferenceCommand, OutputParser.ParseDereferenceOutput);
            GitCliMethod.Create(out _describe, CommandExecutor, CommandBuilder.GetDescribeCommand, OutputParser.ParseDescribeResult);
            GitCliMethod.Create(out _fetch, CommandExecutor, CommandBuilder.GetFetchCommand);
            GitCliMethod.Create(out _formatMergeMessage, CommandExecutor);
            GitCliMethod.Create(out _garbageCollect, CommandExecutor, CommandBuilder.GetGarbageCollectCommand);
            GitCliMethod.Create(out _merge, CommandExecutor, CommandBuilder.GetMergeCommand, OutputParser.HandleMergeResult);
            GitCliMethod.Create(out _pruneNotes, CommandExecutor, CommandBuilder.GetPruneNotesCommand);
            GitCliMethod.Create(out _pruneRemote, CommandExecutor, CommandBuilder.GetPruneRemoteCommand);
            GitCliMethod.Create(out _pull, CommandExecutor, CommandBuilder.GetPullCommand);
            GitCliMethod.Create(out _push, CommandExecutor, CommandBuilder.GetPushCommand, OutputParser.ParsePushResults);
            GitCliMethod.Create(out _queryBlame, CommandExecutor, CommandBuilder.GetQueryBlameCommand, OutputParser.ParseBlame);
            GitCliMethod.Create(out _queryBlobBytes, CommandExecutor, CommandBuilder.GetQueryBlobBytesCommand);
            GitCliMethod.Create(out _queryBranch, CommandExecutor, CommandBuilder.GetQueryBranchCommand, OutputParser.ParseSingleBranch);
            GitCliMethod.Create(out _queryBranches, CommandExecutor, CommandBuilder.GetQueryBranchesCommand, OutputParser.ParseBranches);
            GitCliMethod.Create(out _queryConfig, CommandExecutor, CommandBuilder.GetQueryConfigCommand, OutputParser.ParseQueryConfigResults);
            GitCliMethod.Create(out _queryConfigParameter, CommandExecutor, CommandBuilder.GetQueryConfigParameterCommand, OutputParser.ParseQueryConfigParameterResult);
            GitCliMethod.Create(out _queryDiff, CommandExecutor, CommandBuilder.GetDiffCommand, OutputParser.ParseDiff);
            GitCliMethod.Create(out _queryObjects, CommandExecutor, CommandBuilder.GetQueryObjectsCommand, OutputParser.ParseObjects);
            GitCliMethod.Create(out _queryRevision, CommandExecutor, CommandBuilder.GetQueryRevisionCommand, OutputParser.ParseSingleRevision);
            GitCliMethod.Create(out _queryRevisions, CommandExecutor, CommandBuilder);
            GitCliMethod.Create(out _queryRevisionGraph, CommandExecutor, CommandBuilder.GetQueryRevisionGraphCommand, OutputParser.ParseRevisionGraph);
            GitCliMethod.Create(out _queryNotes, CommandExecutor, CommandBuilder.GetQueryNotesCommand, OutputParser.ParseNotes);
            GitCliMethod.Create(out _queryFilesToAdd, CommandExecutor, CommandBuilder.GetQueryFilesToAddCommand, OutputParser.ParseFilesToAdd);
            GitCliMethod.Create(out _queryFilesToRemove, CommandExecutor, CommandBuilder.GetQueryFilesToRemoveCommand, OutputParser.ParseFilesToRemove);
            GitCliMethod.Create(out _queryFilesToClean, CommandExecutor, CommandBuilder.GetQueryFilesToCleanCommand, OutputParser.ParseFilesToClean);
            GitCliMethod.Create(out _queryRemote, CommandExecutor, CommandBuilder.GetQueryRemoteCommand, OutputParser.ParseSingleRemote);
            GitCliMethod.Create(out _queryRemotes, CommandExecutor, CommandBuilder.GetQueryRemotesCommand, OutputParser.ParseRemotesOutput);
            _querySymbolicReference = new QuerySymbolicReferenceImpl(repository);
            GitCliMethod.Create(out _queryBranchesToPrune, CommandExecutor, CommandBuilder.GetQueryPrunedBranchesCommand, OutputParser.ParsePrunedBranches);
            GitCliMethod.Create(out _queryRemoteReferences, CommandExecutor, CommandBuilder.GetQueryRemoteReferencesCommand, OutputParser.ParseRemoteReferences);
            GitCliMethod.Create(out _queryReferences, CommandExecutor, CommandBuilder.GetQueryReferencesCommand, OutputParser.ParseReferences);
            GitCliMethod.Create(out _queryReflog, CommandExecutor, CommandBuilder.GetQueryReflogCommand);
            GitCliMethod.Create(out _queryStash, CommandExecutor, CommandBuilder.GetQueryStashCommand);
            GitCliMethod.Create(out _queryStashPatch, CommandExecutor, CommandBuilder.GetQueryStashDiffCommand);
            GitCliMethod.Create(out _queryStashTop, CommandExecutor, CommandBuilder.GetQueryStashTopCommand, OutputParser.ParseQueryStashTopOutput);
            GitCliMethod.Create(out _queryStashDiff, CommandExecutor, CommandBuilder.GetQueryStashDiffCommand, OutputParser.ParseRevisionDiff);
            _queryStatus = new QueryStatusImpl(CommandExecutor, CommandBuilder);
            GitCliMethod.Create(out _queryRevisionDiff, CommandExecutor, CommandBuilder.GetQueryRevisionDiffCommand, OutputParser.ParseRevisionDiff);
            GitCliMethod.Create(out _queryRevisionPatch, CommandExecutor, CommandBuilder.GetQueryRevisionDiffCommand);
            GitCliMethod.Create(out _queryTreeContent, CommandExecutor, CommandBuilder.GetQueryTreeContentCommand, OutputParser.ParseTreeContent);
            GitCliMethod.Create(out _queryUsers, CommandExecutor, CommandBuilder.GetQueryUsersCommand, OutputParser.ParseUsers);
            GitCliMethod.Create(out _queryTag, CommandExecutor, CommandBuilder.GetQueryTagCommand, OutputParser.ParseTag);
            GitCliMethod.Create(out _queryTagMessage, CommandExecutor, CommandBuilder.GetQueryTagMessageCommand);
            GitCliMethod.Create(out _queryTags, CommandExecutor, CommandBuilder.GetQueryTagsCommand, OutputParser.ParseTags);
            GitCliMethod.Create(out _removeFiles, CommandExecutor, CommandBuilder.GetRemoveFilesCommand);
            GitCliMethod.Create(out _removeRemoteReferences, CommandExecutor, CommandBuilder.GetRemoveRemoteReferencesCommand);
            GitCliMethod.Create(out _rebase, CommandExecutor, CommandBuilder.GetRebaseCommand);
            GitCliMethod.Create(out _removeRemote, CommandExecutor, CommandBuilder.GetRemoveRemoteCommand);
            GitCliMethod.Create(out _renameBranch, CommandExecutor, CommandBuilder.GetRenameBranchCommand, OutputParser.HandleRenameBranchResult);
            GitCliMethod.Create(out _renameConfigSection, CommandExecutor, CommandBuilder.GetRenameConfigSectionCommand, OutputParser.HandleConfigResults);
            GitCliMethod.Create(out _renameRemote, CommandExecutor, CommandBuilder.GetRenameRemoteCommand);
            GitCliMethod.Create(out _reset, CommandExecutor, CommandBuilder.GetResetCommand);
            GitCliMethod.Create(out _resetFiles, CommandExecutor, CommandBuilder.GetResetFilesCommand);
            GitCliMethod.Create(out _resetBranch, CommandExecutor, CommandBuilder.GetResetBranchCommand);
            GitCliMethod.Create(out _revert, CommandExecutor, CommandBuilder.GetRevertCommand, OutputParser.HandleRevertResult);
            GitCliMethod.Create(out _runMergeTool, CommandExecutor, CommandBuilder.GetRunMergeToolCommand);
            GitCliMethod.Create(out _setConfigValue, CommandExecutor, CommandBuilder.GetSetConfigValueCommand, OutputParser.HandleConfigResults);
            GitCliMethod.Create(out _stashApply, CommandExecutor, CommandBuilder.GetStashApplyCommand, OutputParser.HandleStashApplyResult);
            GitCliMethod.Create(out _stashDrop, CommandExecutor, CommandBuilder.GetStashDropCommand);
            GitCliMethod.Create(out _stashClear, CommandExecutor, CommandBuilder.GetStashClearCommand);
            GitCliMethod.Create(out _stashPop, CommandExecutor, CommandBuilder.GetStashPopCommand, OutputParser.HandleStashPopResult);
            GitCliMethod.Create(out _stashSave, CommandExecutor, CommandBuilder.GetStashSaveCommand, OutputParser.ParseStashSaveResult);
            GitCliMethod.Create(out _stashToBranch, CommandExecutor, CommandBuilder.GetStashToBranchCommand);
            GitCliMethod.Create(out _unsetConfigValue, CommandExecutor, CommandBuilder.GetUnsetConfigValueCommand, OutputParser.HandleConfigResults);
            GitCliMethod.Create(out _updateSubmodule, CommandExecutor, CommandBuilder.GetUpdateSubmoduleCommand);
            GitCliMethod.Create(out _verifyTags, CommandExecutor, CommandBuilder.GetVerifyTagsCommand);
        }