Skipping files which are unreadable by sparkleshare and added some methods for git's exclude file manipulation, see #10
This commit is contained in:
parent
23e59615c9
commit
feaef086f3
|
@ -64,6 +64,10 @@ namespace SparkleLib {
|
||||||
public abstract bool SyncDown ();
|
public abstract bool SyncDown ();
|
||||||
public abstract bool HasUnsyncedChanges { get; set; }
|
public abstract bool HasUnsyncedChanges { get; set; }
|
||||||
|
|
||||||
|
public abstract bool AddExclusionRule (FileSystemEventArgs args);
|
||||||
|
public abstract bool RemoveExclusionRule (FileSystemEventArgs args);
|
||||||
|
public abstract bool CheckExclusionRules ();
|
||||||
|
|
||||||
public delegate void SyncStatusChangedEventHandler (SyncStatus new_status);
|
public delegate void SyncStatusChangedEventHandler (SyncStatus new_status);
|
||||||
public event SyncStatusChangedEventHandler SyncStatusChanged;
|
public event SyncStatusChangedEventHandler SyncStatusChanged;
|
||||||
|
|
||||||
|
@ -316,6 +320,20 @@ namespace SparkleLib {
|
||||||
!args.FullPath.Contains (Path.DirectorySeparatorChar + ".notes"))
|
!args.FullPath.Contains (Path.DirectorySeparatorChar + ".notes"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check whether the file which triggered the action
|
||||||
|
* is readable so that git can actually commit it
|
||||||
|
*/
|
||||||
|
|
||||||
|
try {
|
||||||
|
FileStream file = File.OpenRead(args.FullPath);
|
||||||
|
file.Close();
|
||||||
|
} catch {
|
||||||
|
SparkleHelpers.DebugInfo("Warning", "File " + args.FullPath + " is not readable. Adding to ignore list.");
|
||||||
|
AddExclusionRule(args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
WatcherChangeTypes wct = args.ChangeType;
|
WatcherChangeTypes wct = args.ChangeType;
|
||||||
|
|
||||||
if (AnyDifferences) {
|
if (AnyDifferences) {
|
||||||
|
|
Loading…
Reference in a new issue