repo git: temporarily set core.ignorecase=true when rebasing to prevent conflicts. fixes #721
This commit is contained in:
parent
4818a07315
commit
9bcbec8d84
|
@ -66,6 +66,20 @@ namespace SparkleLib.Git {
|
|||
}
|
||||
|
||||
|
||||
public string StartAndReadStandardError ()
|
||||
{
|
||||
StartInfo.RedirectStandardError = true;
|
||||
Start ();
|
||||
|
||||
// Reading the standard output HAS to go before
|
||||
// WaitForExit, or it will hang forever on output > 4096 bytes
|
||||
string output = StandardError.ReadToEnd ();
|
||||
WaitForExit ();
|
||||
|
||||
return output.TrimEnd ();
|
||||
}
|
||||
|
||||
|
||||
protected string LocateCommand (string name)
|
||||
{
|
||||
string [] possible_command_paths = new string [] {
|
||||
|
|
|
@ -37,8 +37,11 @@ namespace SparkleLib.Git {
|
|||
{
|
||||
// TODO: Set git locale to en-US
|
||||
|
||||
SparkleGit git = new SparkleGit (LocalPath, "config core.ignorecase false");
|
||||
git.StartAndWaitForExit ();
|
||||
|
||||
// Check if we should use git-bin
|
||||
SparkleGit git = new SparkleGit (LocalPath, "config --get filter.bin.clean");
|
||||
git = new SparkleGit (LocalPath, "config --get filter.bin.clean");
|
||||
git.StartAndWaitForExit ();
|
||||
|
||||
this.use_git_bin = (git.ExitCode == 0);
|
||||
|
@ -415,26 +418,41 @@ namespace SparkleLib.Git {
|
|||
Commit (commit_message);
|
||||
}
|
||||
|
||||
SparkleGit git = new SparkleGit (LocalPath, "rebase FETCH_HEAD");
|
||||
git.StartInfo.RedirectStandardOutput = false;
|
||||
// Temporarily change the ignorecase setting to true to avoid
|
||||
// conflicts in file names due to case changes
|
||||
SparkleGit git = new SparkleGit (LocalPath, "config core.ignorecase true");
|
||||
git.StartAndWaitForExit ();
|
||||
|
||||
git = new SparkleGit (LocalPath, "rebase FETCH_HEAD");
|
||||
git.StartInfo.RedirectStandardOutput = false;
|
||||
|
||||
string error_output = git.StartAndReadStandardError ();
|
||||
|
||||
if (git.ExitCode != 0) {
|
||||
SparkleLogger.LogInfo ("Git", Name + " | Conflict detected, trying to get out...");
|
||||
|
||||
// error: cannot stat 'filename': Permission denied
|
||||
if (SparkleBackend.Platform != PlatformID.Unix &&
|
||||
error_output.Contains ("error: cannot stat")) {
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
while (HasLocalChanges) {
|
||||
try {
|
||||
ResolveConflict ();
|
||||
|
||||
} catch (IOException e) {
|
||||
SparkleLogger.LogInfo ("Git",
|
||||
Name + " | Failed to resolve conflict, trying again... (" + e.Message + ")");
|
||||
SparkleLogger.LogInfo ("Git", Name + " | Failed to resolve conflict, trying again... (" + e.Message + ")");
|
||||
}
|
||||
}
|
||||
|
||||
SparkleLogger.LogInfo ("Git", Name + " | Conflict resolved");
|
||||
OnConflictResolved ();
|
||||
}
|
||||
|
||||
git = new SparkleGit (LocalPath, "config core.ignorecase false");
|
||||
git.StartAndWaitForExit ();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue