wimh / SparkleShare

SparkleShare is a file sharing and collaboration tool inspired by Dropbox.
http://www.sparkleshare.org/
GNU General Public License v3.0
39 stars 6 forks source link

Sparkle Share when renaming files in repository #8

Closed andremue closed 13 years ago

andremue commented 13 years ago

If i rename a file in my repository, sparcleshare on a second machine crashes. I think line (493) in file SparkleRepoGit.cs should something like

if ((change_set.Added.Count + change_set.Edited.Count + change_set.Deleted.Count + change_set.MovedFrom.Count) > 0) { change_set.Notes.AddRange (GetNotes (change_set.Revision)); change_sets.Add (change_set); }

instead of

if ((change_set.Added.Count + change_set.Edited.Count + change_set.Deleted.Count > 0) { change_set.Notes.AddRange (GetNotes (change_set.Revision)); change_sets.Add (change_set); }

I changed this an its worked for me.

Second, i changed the platform target to x86, to run sparkleshare under win 64bit.

I hope, I could help. I did not know how I can share my code change to you.

wimh commented 13 years ago

Thank you!

Looks like your patch fixes this, but I like to address the cause of the crash too. I will probably fix both this next weekend. (and get it upstream too) I hoped this version would run under 64bit, but I guess I should have tried it first... ;)

For my own reference: SparkleRepoBase.cs#L446 (untested)

            if (NewChangeSet != null)
                NewChangeSet (GetChangeSets (1) [0], LocalPath);

->

            if (NewChangeSet != null) {
                var changeSets = GetChangeSets (1);
                if (changeSets != null && changeSets.Count > 0)
                    NewChangeSet (changeSets [0], LocalPath);
            }

SparkleRepoGit.cs#L493 hbons/SparkleRepoGit.cs#L487

andremue commented 13 years ago

looks good =)

wimh commented 13 years ago

I pushed the changes to the windows branch;