Esempio n. 1
0
        public int Run(IList <string> args)
        {
            // rcheckin alias -> push
            if (args.Count > 0 && args[0] == "push")
            {
                args[0] = "rcheckin";
            }

            InitializeGlobals();
            _globals.CommandLineRun = "git tfs " + string.Join(" ", args);
            var command      = ExtractCommand(args);
            var unparsedArgs = ParseOptions(command, args);

            UpdateLoggerOnDebugging();
            Trace.WriteLine("Command run:" + _globals.CommandLineRun);
            if (RequiresValidGitRepository(command))
            {
                AssertValidGitRepository();
            }
            bool willCreateRepository = command.GetType() == typeof(Clone) || command.GetType() == typeof(Init);

            ParseAuthorsAndSave(!willCreateRepository);
            var exitCode = Main(command, unparsedArgs);

            if (willCreateRepository)
            {
                _authorsFileHelper.SaveAuthorFileInRepository(_globals.AuthorsFilePath, _globals.GitDir);
            }
            return(exitCode);
        }
Esempio n. 2
0
        public int Run(IList <string> args)
        {
            InitializeGlobals();
            _globals.CommandLineRun = "git tfs " + string.Join(" ", args);
            var command      = ExtractCommand(args);
            var unparsedArgs = ParseOptions(command, args);

            UpdateLoggerOnDebugging();
            Trace.WriteLine("Command run: [" + _globals.CommandLineRun + "]");
            if (_globals.DebugOutput)
            {
                foreach (var arg in args)
                {
                    Trace.WriteLine("Arg: [" + arg + "]");
                }
            }
            if (RequiresValidGitRepository(command))
            {
                AssertValidGitRepository();
            }
            bool willCreateRepository = command.GetType() == typeof(Clone) || command.GetType() == typeof(Init);

            ParseAuthorsAndSave(!willCreateRepository);
            var exitCode = Main(command, unparsedArgs);

            if (willCreateRepository)
            {
                _authorsFileHelper.SaveAuthorFileInRepository(_globals.AuthorsFilePath, _globals.GitDir);
            }
            return(exitCode);
        }
Esempio n. 3
0
 private void SaveAuthorFileInRepository()
 {
     _authorsFileHelper.SaveAuthorFileInRepository(_globals.AuthorsFilePath, _globals.GitDir);
 }