repo: Fix edge case where ID may be empty
This commit is contained in:
parent
f753e0e36c
commit
6dd657a086
|
@ -157,8 +157,7 @@ namespace SparkleLib.Git {
|
|||
}
|
||||
|
||||
|
||||
public override bool HasRemoteChanges
|
||||
{
|
||||
public override bool HasRemoteChanges {
|
||||
get {
|
||||
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Checking for remote changes...");
|
||||
SparkleGit git = new SparkleGit (LocalPath, "ls-remote \"" + RemoteUrl + "\" master");
|
||||
|
@ -393,17 +392,6 @@ namespace SparkleLib.Git {
|
|||
}
|
||||
|
||||
|
||||
// Removes unneeded objects
|
||||
/* private void CollectGarbage ()
|
||||
{
|
||||
SparkleGit git = new SparkleGit (LocalPath, "gc");
|
||||
git.Start ();
|
||||
git.WaitForExit ();
|
||||
|
||||
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Garbage collected.");
|
||||
} */
|
||||
|
||||
|
||||
// Commits the made changes
|
||||
private void Commit (string message)
|
||||
{
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace SparkleLib {
|
|||
{
|
||||
if (!this.channels.Contains (channel) && IsConnected) {
|
||||
SparkleHelpers.DebugInfo ("Listener",
|
||||
"Subscribing to channel " + channel);
|
||||
"Subscribing to channel " + channel + " on " + Server);
|
||||
|
||||
this.channels.Add (channel);
|
||||
AlsoListenToInternal (channel);
|
||||
|
|
|
@ -205,9 +205,6 @@ namespace SparkleLib {
|
|||
|
||||
protected override void AlsoListenToInternal (string folder_identifier)
|
||||
{
|
||||
SparkleHelpers.DebugInfo ("ListenerTcp",
|
||||
"Subscribing to channel " + folder_identifier + " on " + Server);
|
||||
|
||||
string to_send = "subscribe " + folder_identifier + "\n";
|
||||
|
||||
try {
|
||||
|
|
|
@ -139,20 +139,24 @@ namespace SparkleLib {
|
|||
|
||||
public string Identifier {
|
||||
get {
|
||||
if (this.identifier == null) {
|
||||
string id_path = Path.Combine (LocalPath, ".sparkleshare");
|
||||
|
||||
if (File.Exists (id_path)) {
|
||||
this.identifier = File.ReadAllText (id_path).Trim ();
|
||||
|
||||
} else {
|
||||
this.identifier = ComputeIdentifier ();
|
||||
File.WriteAllText (id_path, this.identifier);
|
||||
File.SetAttributes (id_path, FileAttributes.Hidden);
|
||||
}
|
||||
}
|
||||
if (this.identifier != null)
|
||||
return this.identifier;
|
||||
|
||||
string id_path = Path.Combine (LocalPath, ".sparkleshare");
|
||||
|
||||
return this.identifier;
|
||||
if (File.Exists (id_path))
|
||||
this.identifier = File.ReadAllText (id_path).Trim ();
|
||||
|
||||
if (this.identifier != null && this.identifier.Length > 0) {
|
||||
return this.identifier;
|
||||
|
||||
} else {
|
||||
this.identifier = ComputeIdentifier ();
|
||||
File.WriteAllText (id_path, this.identifier);
|
||||
File.SetAttributes (id_path, FileAttributes.Hidden);
|
||||
|
||||
return this.identifier;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue