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:
parent
9d3fd8888d
commit
8829c2145e
|
@ -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...");
|
||||
|
|
Loading…
Reference in a new issue