[repo] port Commit method to use GitSharp
This commit is contained in:
parent
b504a8f074
commit
45e6cd19b5
|
@ -14,6 +14,7 @@
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
using GitSharp;
|
||||||
using Meebey.SmartIrc4net;
|
using Meebey.SmartIrc4net;
|
||||||
using Mono.Unix;
|
using Mono.Unix;
|
||||||
using System;
|
using System;
|
||||||
|
@ -25,7 +26,7 @@ using System.Timers;
|
||||||
|
|
||||||
namespace SparkleLib {
|
namespace SparkleLib {
|
||||||
|
|
||||||
public class SparkleRepo {
|
public class SparkleRepo : Repository {
|
||||||
|
|
||||||
private Process Process;
|
private Process Process;
|
||||||
private Timer RemoteTimer;
|
private Timer RemoteTimer;
|
||||||
|
@ -261,7 +262,7 @@ namespace SparkleLib {
|
||||||
public event CommitEndedUpEmptyEventHandler CommitEndedUpEmpty;
|
public event CommitEndedUpEmptyEventHandler CommitEndedUpEmpty;
|
||||||
|
|
||||||
|
|
||||||
public SparkleRepo (string path)
|
public SparkleRepo (string path) : base (path)
|
||||||
{
|
{
|
||||||
|
|
||||||
LocalPath = path;
|
LocalPath = path;
|
||||||
|
@ -599,23 +600,16 @@ namespace SparkleLib {
|
||||||
|
|
||||||
|
|
||||||
// Commits the made changes
|
// Commits the made changes
|
||||||
public void Commit (string message)
|
new public void Commit (string message)
|
||||||
{
|
{
|
||||||
|
|
||||||
Process.StartInfo.Arguments = "status --porcelain";
|
if (!Status.AnyDifferences)
|
||||||
Process.Start ();
|
|
||||||
Process.WaitForExit ();
|
|
||||||
|
|
||||||
if (Process.StandardOutput.ReadToEnd ().TrimEnd ("\n".ToCharArray ()).Equals (""))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
base.Commit (message);
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Commit", "[" + Name + "] " + message);
|
SparkleHelpers.DebugInfo ("Commit", "[" + Name + "] " + message);
|
||||||
|
|
||||||
Process.StartInfo.Arguments = "commit -m \"" + message + "\"";
|
|
||||||
|
|
||||||
Process.Start ();
|
|
||||||
Process.WaitForExit ();
|
|
||||||
|
|
||||||
SparkleEventArgs args = new SparkleEventArgs ("Commited");
|
SparkleEventArgs args = new SparkleEventArgs ("Commited");
|
||||||
args.Message = message;
|
args.Message = message;
|
||||||
|
|
||||||
|
@ -852,13 +846,15 @@ namespace SparkleLib {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Dispose ()
|
new public void Dispose ()
|
||||||
{
|
{
|
||||||
|
|
||||||
RemoteTimer.Dispose ();
|
RemoteTimer.Dispose ();
|
||||||
LocalTimer.Dispose ();
|
LocalTimer.Dispose ();
|
||||||
Listener.Dispose ();
|
Listener.Dispose ();
|
||||||
|
|
||||||
|
base.Dispose ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -871,7 +867,7 @@ namespace SparkleLib {
|
||||||
file_path.Contains (".git") ||
|
file_path.Contains (".git") ||
|
||||||
file_path.Contains ("/.") ||
|
file_path.Contains ("/.") ||
|
||||||
file_path.EndsWith (".swp") ||
|
file_path.EndsWith (".swp") ||
|
||||||
Directory.Exists (LocalPath + file_path)) {
|
System.IO.Directory.Exists (LocalPath + file_path)) {
|
||||||
|
|
||||||
return true; // Yes, ignore it
|
return true; // Yes, ignore it
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue