Skip to content

Commit

Permalink
Reorganize / Alphabetize file.
Browse files Browse the repository at this point in the history
  • Loading branch information
otac0n committed Apr 5, 2014
1 parent 936226d commit 11bb8a6
Show file tree
Hide file tree
Showing 44 changed files with 945 additions and 978 deletions.
2 changes: 0 additions & 2 deletions SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
[assembly: AssemblyCopyright("Copyright © John Gietzen 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

[assembly: AssemblyVersion("2.1.*")]
[assembly: AssemblyFileVersion("2.1.0.0")]
24 changes: 12 additions & 12 deletions WebGitNet.SearchProviders/PathSearchProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ public Task<IList<SearchResult>> Search(SearchQuery query, FileManager fileManag
}
}

public IEnumerable<SearchResult> Search(SearchQuery query, FileManager fileManager)
{
var repos = from dir in fileManager.DirectoryInfo.EnumerateDirectories()
let repoInfo = GitUtilities.GetRepoInfo(dir.FullName)
where repoInfo.IsGitRepo
select repoInfo;

return from repo in repos
from searchResult in Search(query, repo, includeRepoName: true)
select searchResult;
}

private IEnumerable<SearchResult> Search(SearchQuery query, RepoInfo repo, bool includeRepoName = false)
{
TreeView tree;
Expand Down Expand Up @@ -79,17 +91,5 @@ private IEnumerable<SearchResult> Search(SearchQuery query, RepoInfo repo, bool
}
}
}

public IEnumerable<SearchResult> Search(SearchQuery query, FileManager fileManager)
{
var repos = from dir in fileManager.DirectoryInfo.EnumerateDirectories()
let repoInfo = GitUtilities.GetRepoInfo(dir.FullName)
where repoInfo.IsGitRepo
select repoInfo;

return from repo in repos
from searchResult in Search(query, repo, includeRepoName: true)
select searchResult;
}
}
}
26 changes: 13 additions & 13 deletions WebGitNet.SearchProviders/RepoGrepSearchProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Search;
using System.Threading.Tasks;
using Search;

public class RepoGrepSearchProvider : ISearchProvider
{
Expand All @@ -20,6 +20,18 @@ public Task<IList<SearchResult>> Search(SearchQuery query, FileManager fileManag
}
}

public IEnumerable<SearchResult> Search(SearchQuery query, FileManager fileManager)
{
var repos = from dir in fileManager.DirectoryInfo.EnumerateDirectories()
let repoInfo = GitUtilities.GetRepoInfo(dir.FullName)
where repoInfo.IsGitRepo
select repoInfo;

return from repo in repos
from searchResult in Search(query, repo, includeRepoName: true)
select searchResult;
}

private IEnumerable<SearchResult> Search(SearchQuery query, RepoInfo repo, bool includeRepoName = false)
{
var allTerms = string.Join(" --or ", query.Terms.Select(t => "-e " + GitUtilities.Q(t)));
Expand Down Expand Up @@ -47,17 +59,5 @@ group searchLine by filePath into g
Lines = g.ToList(),
};
}

public IEnumerable<SearchResult> Search(SearchQuery query, FileManager fileManager)
{
var repos = from dir in fileManager.DirectoryInfo.EnumerateDirectories()
let repoInfo = GitUtilities.GetRepoInfo(dir.FullName)
where repoInfo.IsGitRepo
select repoInfo;

return from repo in repos
from searchResult in Search(query, repo, includeRepoName: true)
select searchResult;
}
}
}
3 changes: 1 addition & 2 deletions WebGitNet.SearchProviders/RepoInfoSearchProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebGitNet.Search;
using System.Threading.Tasks;
using WebGitNet.Search;

public class RepoInfoSearchProvider : ISearchProvider
{
Expand Down
12 changes: 6 additions & 6 deletions WebGitNet.SharedLib/BreadCrumbTrail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ IEnumerator IEnumerable.GetEnumerator()

public sealed class BreadCrumb
{
private readonly string name;
private readonly string controller;
private readonly string action;
private readonly string controller;
private readonly string name;
private readonly object routeValues;

public BreadCrumb(string name, string controller, string action, object routeValues)
Expand Down Expand Up @@ -108,11 +108,11 @@ public BreadCrumb(string name, string controller, string action, object routeVal
this.routeValues = routeValues;
}

public string Name
public string Action
{
get
{
return this.name;
return this.action;
}
}

Expand All @@ -124,11 +124,11 @@ public string Controller
}
}

public string Action
public string Name
{
get
{
return this.action;
return this.name;
}
}

Expand Down
38 changes: 19 additions & 19 deletions WebGitNet.SharedLib/DiffInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ namespace WebGitNet

public class DiffInfo
{
private readonly bool added;
private readonly bool copied;
private readonly bool deleted;
private readonly string destinationFile;
private readonly IList<string> headers;
private readonly IList<string> lines;
private readonly string sourceFile;
private readonly string destinationFile;
private readonly bool renamed;
private readonly bool copied;
private readonly bool added;
private readonly bool deleted;
private readonly string sourceFile;

public DiffInfo(IList<string> lines)
{
Expand All @@ -48,44 +48,44 @@ public DiffInfo(IList<string> lines)
this.deleted = this.headers.Any(h => h.StartsWith("deleted file"));
}

public IList<string> Headers
public bool Added
{
get { return this.headers; }
get { return this.added; }
}

public IList<string> Lines
public bool Copied
{
get { return this.lines; }
get { return this.copied; }
}

public string SourceFile
public bool Deleted
{
get { return this.sourceFile; }
get { return this.deleted; }
}

public string DestinationFile
{
get { return this.destinationFile; }
}

public bool Renamed
public IList<string> Headers
{
get { return this.renamed; }
get { return this.headers; }
}

public bool Copied
public IList<string> Lines
{
get { return this.copied; }
get { return this.lines; }
}

public bool Added
public bool Renamed
{
get { return this.added; }
get { return this.renamed; }
}

public bool Deleted
public string SourceFile
{
get { return this.deleted; }
get { return this.sourceFile; }
}
}
}
2 changes: 1 addition & 1 deletion WebGitNet.SharedLib/FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace WebGitNet

public class FileManager
{
private readonly string rootPath;
private readonly DirectoryInfo dirInfo;
private readonly string rootPath;

public FileManager(string path)
{
Expand Down
10 changes: 5 additions & 5 deletions WebGitNet.SharedLib/GitErrorException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace WebGitNet
public class GitErrorException : Exception
{
private readonly string command;
private readonly int exitCode;
private readonly string errorOutput;
private readonly int exitCode;

public GitErrorException(string command, string workingDir, int exitCode, string errorOutput)
: base("Fatal error executing git command in '" + workingDir + "'." + Environment.NewLine + errorOutput)
Expand All @@ -28,14 +28,14 @@ public string Command
get { return this.command; }
}

public int ExitCode
public string ErrorOutput
{
get { return this.exitCode; }
get { return this.errorOutput; }
}

public string ErrorOutput
public int ExitCode
{
get { return this.errorOutput; }
get { return this.exitCode; }
}
}
}
4 changes: 2 additions & 2 deletions WebGitNet.SharedLib/GitRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public GitRef(string shaId, string refPath)
throw new ArgumentException("The ref path specified is not recognized.", "refPath");
}

public string ShaId { get; private set; }

public string Name { get; private set; }

public string RefPath { get; private set; }

public RefType RefType { get; private set; }

public string ShaId { get; private set; }
}
}
Loading

0 comments on commit 11bb8a6

Please sign in to comment.