repo: use the first commit hash as an id for the repo and use that as the channel name' did not match any files

This commit is contained in:
Hylke Bons 2011-05-14 18:11:31 +01:00
parent 5f36f8a9e0
commit 7235d9fa30

View file

@ -186,7 +186,7 @@ namespace SparkleLib {
else
server_type = NotificationServerType.Own;
this.listener = new SparkleListenerIrc (Domain, RemoteName, server_type);
this.listener = new SparkleListenerIrc (Domain, Identifier, server_type);
// ...fetch remote changes every 60 seconds if that fails
this.remote_timer = new Timer () {
@ -266,6 +266,22 @@ namespace SparkleLib {
}
public string Identifier {
get {
// Because git computes a hash based on content,
// author, and timestamp; it is unique enough to
// use the hash of the first commit as an identifier
// for our folder
SparkleGit git = new SparkleGit (LocalPath, "log --reverse -1 --format=%H");
git.Start ();
git.WaitForExit ();
return git.StandardOutput.ReadToEnd ().Trim ();
}
}
private void CheckForRemoteChanges ()
{
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Checking for remote changes...");