Hi Team,
I have integrated bitbucket in our application and I am trying to add a folder that contains approx. 400+ .md files using git command (add *) programmatically using C# code, but these files remains untracked. It works fine for .txt and .json files.
Below is the sample code :
bitbucketService.ExecuteGitWindowsCommand(mainDirectory, $"checkout -b {BranchName}");
//Code to copy some extra file and folders that contains .md file in checkout branch.
.
.
.
//Code to add .md files using git command
bitbucketService.ExecuteGitWindowsCommand(mainDirectory, @$"add *");
public string ExecuteGitWindowsCommand(string workingDirectory, string arguments)
{
string command_result;
Process ps = new Process();
ps.StartInfo.FileName = GitExePath;
ps.StartInfo.UseShellExecute = false;
ps.StartInfo.RedirectStandardOutput = true;
ps.StartInfo.RedirectStandardInput = true;
ps.StartInfo.RedirectStandardError = true;
ps.StartInfo.WorkingDirectory = workingDirectory;
ps.StartInfo.Arguments = arguments;
ps.Start();
command_result = ps.StandardOutput.ReadToEnd();
ps.StandardInput.WriteLine("exit");
ps = null;
return command_result;
}
It works fine for .txt and .json files. but if the folder contains more(25+) .md files then it get fail or stuck at code command_result = ps.StandardOutput.ReadToEnd();
Any help would be apricated thanks.