Skip to content

Commit e2ad170

Browse files
committed
Conflicts:
README.md
1 parent 88cbbd3 commit e2ad170

File tree

10 files changed

+118
-314
lines changed

10 files changed

+118
-314
lines changed

BasicSccProvider.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,17 @@
8585
</EmbeddedResource>
8686
</ItemGroup>
8787
<ItemGroup>
88+
<Content Include="License.txt">
89+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
90+
<IncludeInVSIX>true</IncludeInVSIX>
91+
</Content>
8892
<Content Include="Resources\Images_24bit.bmp" />
8993
<Content Include="Resources\Images_32bit.bmp" />
9094
<Content Include="Resources\SccGlyphs.bmp" />
95+
<Content Include="solution explorer.png">
96+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
97+
<IncludeInVSIX>true</IncludeInVSIX>
98+
</Content>
9199
<None Include="source.extension.vsixmanifest" />
92100
<None Include="Resources\Product.ico" />
93101
</ItemGroup>

GitFileStatusTracker.cs

Lines changed: 7 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ public class GitFileStatusTracker
1111
{
1212
private RepositoryStatus repositoryStatus;
1313
private Uri workingFolderUri;
14-
//private FileSystemWatcher watcher;
15-
//private IgnoreRules ignoreRules;
1614

1715
public GitFileStatusTracker()
1816
{
@@ -23,47 +21,18 @@ public void Open(string workingFolder)
2321
{
2422
Close();
2523

26-
if (!string.IsNullOrEmpty(workingFolder))
24+
if (!string.IsNullOrEmpty(workingFolder) && Repository.IsValid(workingFolder))
2725
{
2826
try
2927
{
3028
var repo = new Repository(workingFolder);
3129
this.repositoryStatus = repo.Status;
3230
this.workingFolderUri = new Uri(repo.WorkingDirectory+"\\");
33-
//this.ignoreRules = new IgnoreRules(Path.Combine(repo.WorkingDirectory, GitSharp.Core.Constants.GITIGNORE_FILENAME));
34-
35-
//this.watcher = new FileSystemWatcher(workingFolder + "\\" + GitSharp.Core.Constants.DOT_GIT); //?
36-
////this.watcher = new FileSystemWatcher(workingFolder); //?
37-
38-
//this.watcher.NotifyFilter = NotifyFilters.LastWrite;
39-
//this.watcher.EnableRaisingEvents = true;
40-
//this.watcher.Changed += new FileSystemEventHandler(watcher_Changed);
4131
}
4232
catch
4333
{
4434
}
4535
}
46-
47-
}
48-
49-
private DateTime TimeFired;
50-
public event EventHandler OnGitRepoChanged;
51-
private object locker = new object();
52-
53-
void watcher_Changed(object sender, FileSystemEventArgs e)
54-
{
55-
lock (locker)
56-
{
57-
double delta = DateTime.Now.Subtract(TimeFired).TotalMilliseconds;
58-
if (delta < 500) return;
59-
60-
//if (IsIgnoredFile(e.FullPath)) return;
61-
62-
this.repositoryStatus.Update();
63-
if (OnGitRepoChanged != null) OnGitRepoChanged(this, EventArgs.Empty);
64-
65-
TimeFired = DateTime.Now;
66-
}
6736
}
6837

6938
public bool HasGitRepository
@@ -76,39 +45,8 @@ public void Close()
7645
if (this.repositoryStatus != null) this.repositoryStatus.Repository.Close();
7746
this.repositoryStatus = null;
7847
this.workingFolderUri = null;
79-
//this.ignoreRules = null;
80-
81-
//if (this.watcher != null)
82-
//{
83-
// this.watcher.Changed -= new FileSystemEventHandler(watcher_Changed);
84-
// this.watcher.Dispose();
85-
//}
86-
8748
}
8849

89-
//private bool IsIgnoredFile(string fileName)
90-
//{
91-
// try
92-
// {
93-
// if (Directory.Exists(fileName))
94-
// {
95-
// return this.ignoreRules.IgnoreDir(this.repositoryStatus.Repository.WorkingDirectory, fileName);
96-
// }
97-
// else if (File.Exists(fileName))
98-
// {
99-
// return this.ignoreRules.IgnoreDir(this.repositoryStatus.Repository.WorkingDirectory,
100-
// Path.GetDirectoryName(fileName)) ||
101-
// this.ignoreRules.IgnoreFile(this.repositoryStatus.Repository.WorkingDirectory, fileName);
102-
// }
103-
// else
104-
// return true;
105-
// }
106-
// catch
107-
// {
108-
// return false;
109-
// }
110-
//}
111-
11250
public GitFileStatus GetFileStatus(string fileName)
11351
{
11452
if (!HasGitRepository || string.IsNullOrEmpty(fileName) || !File.Exists(fileName))
@@ -137,6 +75,12 @@ public GitFileStatus GetFileStatus(string fileName)
13775
return GitFileStatus.Trackered;
13876
}
13977
}
78+
79+
internal void Update()
80+
{
81+
if (this.repositoryStatus!=null)
82+
this.repositoryStatus.Update();
83+
}
14084
}
14185

14286
public static class HashSetExt

License.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Microsoft Public License (Ms-PL)
2+
3+
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
4+
5+
1. Definitions
6+
7+
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
8+
9+
A "contribution" is the original software, or any additions or changes to the software.
10+
11+
A "contributor" is any person that distributes its contribution under this license.
12+
13+
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
14+
15+
2. Grant of Rights
16+
17+
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
18+
19+
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
20+
21+
3. Conditions and Limitations
22+
23+
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
24+
25+
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
26+
27+
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
28+
29+
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
30+
31+
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.

Overview.xml

Lines changed: 0 additions & 221 deletions
This file was deleted.

Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
2222
[assembly: AssemblyTitle("Git Source Control Provider")]
2323
[assembly: AssemblyDescription("")]
2424
[assembly: AssemblyConfiguration("")]
25-
[assembly: AssemblyCompany("")]
25+
[assembly: AssemblyCompany("[email protected]")]
2626
[assembly: AssemblyProduct("Git Source Control Provider")]
2727
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
2828
[assembly: AssemblyTrademark("")]

0 commit comments

Comments
 (0)