Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit dcf27c9

Browse files
neuroKipshana
authored andcommitted
Styling fixes
1 parent 67ed791 commit dcf27c9

File tree

6 files changed

+127
-127
lines changed

6 files changed

+127
-127
lines changed

src/GitHub.Api/Git/GitClient.cs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ ITask<string> Add(IList<string> files,
6969

7070
ITask<string> AddAll(IOutputProcessor<string> processor = null);
7171

72-
ITask<string> Discard( IList<string> files,
73-
IOutputProcessor<string> processor = null );
72+
ITask<string> Discard(IList<string> files,
73+
IOutputProcessor<string> processor = null);
7474

75-
ITask<string> DiscardAll( IOutputProcessor<string> processor = null );
75+
ITask<string> DiscardAll(IOutputProcessor<string> processor = null);
7676

77-
ITask<string> Remove(IList<string> files,
77+
ITask<string> Remove(IList<string> files,
7878
IOutputProcessor<string> processor = null);
7979

8080
ITask<string> AddAndCommit(IList<string> files, string message, string body,
@@ -370,38 +370,38 @@ public ITask<string> Add(IList<string> files,
370370
return last;
371371
}
372372

373-
public ITask<string> Discard( IList<string> files,
374-
IOutputProcessor<string> processor = null )
375-
{
376-
Logger.Trace("Checkout Files");
377-
378-
GitCheckoutTask last = null;
379-
foreach( var batch in files.Spool( 5000 ) )
380-
{
381-
var current = new GitCheckoutTask( batch, cancellationToken, processor ).Configure( processManager );
382-
if( last == null )
383-
{
384-
last = current;
385-
}
386-
else
387-
{
388-
last.Then( current );
389-
last = current;
390-
}
391-
}
392-
393-
return last;
394-
}
395-
396-
public ITask<string> DiscardAll( IOutputProcessor<string> processor = null )
397-
{
398-
Logger.Trace( "Checkout all files" );
399-
400-
return new GitCheckoutTask( cancellationToken, processor )
401-
.Configure( processManager );
402-
}
403-
404-
public ITask<string> Remove(IList<string> files,
373+
public ITask<string> Discard( IList<string> files,
374+
IOutputProcessor<string> processor = null)
375+
{
376+
Logger.Trace("Checkout Files");
377+
378+
GitCheckoutTask last = null;
379+
foreach (var batch in files.Spool(5000))
380+
{
381+
var current = new GitCheckoutTask(batch, cancellationToken, processor).Configure(processManager);
382+
if (last == null)
383+
{
384+
last = current;
385+
}
386+
else
387+
{
388+
last.Then(current);
389+
last = current;
390+
}
391+
}
392+
393+
return last;
394+
}
395+
396+
public ITask<string> DiscardAll(IOutputProcessor<string> processor = null)
397+
{
398+
Logger.Trace("Checkout all files");
399+
400+
return new GitCheckoutTask(cancellationToken, processor)
401+
.Configure(processManager);
402+
}
403+
404+
public ITask<string> Remove(IList<string> files,
405405
IOutputProcessor<string> processor = null)
406406
{
407407
Logger.Trace("Remove");

src/GitHub.Api/Git/IRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public interface IRepository : IEquatable<IRepository>
1818
ITask Revert(string changeset);
1919
ITask RequestLock(string file);
2020
ITask ReleaseLock(string file, bool force);
21-
ITask CheckoutFiles( List<string> files );
21+
ITask CheckoutFiles(List<string> files);
2222

2323
void CheckLogChangedEvent(CacheUpdateEvent gitLogCacheUpdateEvent);
2424
void CheckStatusChangedEvent(CacheUpdateEvent cacheUpdateEvent);

src/GitHub.Api/Git/Repository.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ public ITask ReleaseLock(string file, bool force)
112112
return repositoryManager.UnlockFile(file, force);
113113
}
114114

115-
public ITask CheckoutFiles( List<string> files )
116-
{
117-
return repositoryManager.CheckoutFiles( files );
118-
}
115+
public ITask CheckoutFiles(List<string> files)
116+
{
117+
return repositoryManager.CheckoutFiles(files);
118+
}
119119

120120
public void CheckLogChangedEvent(CacheUpdateEvent cacheUpdateEvent)
121121
{

src/GitHub.Api/Git/RepositoryManager.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public interface IRepositoryManager : IDisposable
3535
ITask CreateBranch(string branch, string baseBranch);
3636
ITask LockFile(string file);
3737
ITask UnlockFile(string file, bool force);
38-
ITask CheckoutFiles(List<string> files);
38+
ITask CheckoutFiles(List<string> files);
3939
void UpdateGitLog();
4040
void UpdateGitStatus();
4141
void UpdateGitAheadBehindStatus();
@@ -285,13 +285,13 @@ public void UpdateGitStatus()
285285
}).Start();
286286
}
287287

288-
public ITask CheckoutFiles( List<string> files )
289-
{
290-
var discard = GitClient.Discard(files);
291-
discard.OnStart += t => IsBusy = true;
288+
public ITask CheckoutFiles(List<string> files)
289+
{
290+
var discard = GitClient.Discard(files);
291+
discard.OnStart += t => IsBusy = true;
292292

293-
return discard.Finally(() => IsBusy = false);
294-
}
293+
return discard.Finally(() => IsBusy = false);
294+
}
295295

296296
public void UpdateGitAheadBehindStatus()
297297
{

src/GitHub.Api/Git/Tasks/GitCheckoutTask.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,33 @@
44

55
namespace GitHub.Unity
66
{
7-
class GitCheckoutTask : ProcessTask<string>
8-
{
9-
private const string TaskName = "git checkout";
10-
private readonly string arguments;
7+
class GitCheckoutTask : ProcessTask<string>
8+
{
9+
private const string TaskName = "git checkout";
10+
private readonly string arguments;
1111

12-
public GitCheckoutTask( IEnumerable<string> files, CancellationToken token,
13-
IOutputProcessor<string> processor = null ) : base(token, processor ?? new SimpleOutputProcessor())
14-
{
15-
Guard.ArgumentNotNull( files, "files" );
16-
Name = TaskName;
12+
public GitCheckoutTask(IEnumerable<string> files, CancellationToken token,
13+
IOutputProcessor<string> processor = null) : base(token, processor ?? new SimpleOutputProcessor())
14+
{
15+
Guard.ArgumentNotNull(files, "files");
16+
Name = TaskName;
1717

18-
arguments = "checkout ";
19-
arguments += " -- ";
18+
arguments = "checkout ";
19+
arguments += " -- ";
2020

21-
foreach( var file in files )
22-
{
23-
arguments += " \"" + file.ToNPath().ToString( SlashMode.Forward ) + "\"";
24-
}
25-
}
21+
foreach (var file in files)
22+
{
23+
arguments += " \"" + file.ToNPath().ToString(SlashMode.Forward) + "\"";
24+
}
25+
}
2626

27-
public GitCheckoutTask( CancellationToken token,
28-
IOutputProcessor<string> processor = null ) : base( token, processor ?? new SimpleOutputProcessor() )
29-
{
30-
arguments = "checkout -- .";
31-
}
27+
public GitCheckoutTask(CancellationToken token,
28+
IOutputProcessor<string> processor = null) : base(token, processor ?? new SimpleOutputProcessor())
29+
{
30+
arguments = "checkout -- .";
31+
}
3232

33-
public override string ProcessArguments { get { return arguments; } }
34-
public override TaskAffinity Affinity { get { return TaskAffinity.Exclusive; } }
35-
}
33+
public override string ProcessArguments { get { return arguments; } }
34+
public override TaskAffinity Affinity { get { return TaskAffinity.Exclusive; } }
35+
}
3636
}

src/tests/IntegrationTests/Events/RepositoryManagerTests.cs

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -758,61 +758,61 @@ public async Task ShouldDetectGitFetch()
758758

759759

760760

761-
[Test]
762-
public async Task ShouldCheckoutFiles()
763-
{
764-
await Initialize( TestRepoMasterCleanSynchronized );
765-
766-
var repositoryManagerListener = Substitute.For<IRepositoryManagerListener>();
767-
repositoryManagerListener.AttachListener( RepositoryManager, repositoryManagerEvents );
768-
769-
var expected = new GitStatus
770-
{
771-
Behind = 1,
772-
LocalBranch = "master",
773-
RemoteBranch = "origin/master",
774-
Entries =
775-
new List<GitStatusEntry> {
776-
new GitStatusEntry("foobar.txt", TestRepoMasterCleanSynchronized.Combine("foobar.txt"),
777-
"foobar.txt", GitFileStatus.Untracked)
778-
}
779-
};
780-
781-
var result = new GitStatus();
782-
Environment.Repository.OnStatusUpdated += status => { result = status; };
783-
784-
var foobarTxt = TestRepoMasterCleanSynchronized.Combine( "foobar.txt" );
785-
foobarTxt.WriteAllText( "foobar" );
786-
787-
await TaskManager.Wait();
788-
RepositoryManager.WaitForEvents();
789-
WaitForNotBusy( repositoryManagerEvents, 1 );
790-
791-
repositoryManagerListener.Received().OnStatusUpdate( Args.GitStatus );
792-
repositoryManagerListener.DidNotReceive().OnActiveBranchChanged( Arg.Any<ConfigBranch?>() );
793-
repositoryManagerListener.DidNotReceive().OnActiveRemoteChanged( Arg.Any<ConfigRemote?>() );
794-
repositoryManagerListener.DidNotReceive().OnLocalBranchListChanged();
795-
repositoryManagerListener.DidNotReceive().OnRemoteBranchListChanged();
796-
repositoryManagerListener.Received().OnIsBusyChanged( Args.Bool );
797-
repositoryManagerListener.DidNotReceive().OnLocksUpdated( Args.EnumerableGitLock );
798-
799-
await RepositoryManager.CheckoutFiles( new List<string>() { "foobar.txt" } )
800-
.StartAsAsync();
801-
802-
await TaskManager.Wait();
803-
RepositoryManager.WaitForEvents();
804-
WaitForNotBusy( repositoryManagerEvents, 1 );
805-
repositoryManagerEvents.OnStatusUpdate.WaitOne( TimeSpan.FromSeconds( 1 ) );
806-
807-
repositoryManagerListener.Received().OnStatusUpdate( Args.GitStatus );
808-
repositoryManagerListener.DidNotReceive().OnActiveBranchChanged( Arg.Any<ConfigBranch?>() );
809-
repositoryManagerListener.DidNotReceive().OnActiveRemoteChanged( Arg.Any<ConfigRemote?>() );
810-
repositoryManagerListener.DidNotReceive().OnLocalBranchListChanged();
811-
repositoryManagerListener.DidNotReceive().OnRemoteBranchListChanged();
812-
repositoryManagerListener.Received().OnIsBusyChanged( Args.Bool );
813-
repositoryManagerListener.DidNotReceive().OnLocksUpdated( Args.EnumerableGitLock );
814-
815-
result.AssertEqual( expected );
761+
[Test]
762+
public async Task ShouldCheckoutFiles()
763+
{
764+
await Initialize(TestRepoMasterCleanSynchronized);
765+
766+
var repositoryManagerListener = Substitute.For<IRepositoryManagerListener>();
767+
repositoryManagerListener.AttachListener(RepositoryManager, repositoryManagerEvents);
768+
769+
var expected = new GitStatus
770+
{
771+
Behind = 1,
772+
LocalBranch = "master",
773+
RemoteBranch = "origin/master",
774+
Entries =
775+
new List<GitStatusEntry> {
776+
new GitStatusEntry("foobar.txt", TestRepoMasterCleanSynchronized.Combine("foobar.txt"),
777+
"foobar.txt", GitFileStatus.Untracked)
778+
}
779+
};
780+
781+
var result = new GitStatus();
782+
Environment.Repository.OnStatusUpdated += status => { result = status; };
783+
784+
var foobarTxt = TestRepoMasterCleanSynchronized.Combine("foobar.txt");
785+
foobarTxt.WriteAllText("foobar");
786+
787+
await TaskManager.Wait();
788+
RepositoryManager.WaitForEvents();
789+
WaitForNotBusy(repositoryManagerEvents, 1);
790+
791+
repositoryManagerListener.Received().OnStatusUpdate(Args.GitStatus);
792+
repositoryManagerListener.DidNotReceive().OnActiveBranchChanged(Arg.Any<ConfigBranch?>());
793+
repositoryManagerListener.DidNotReceive().OnActiveRemoteChanged(Arg.Any<ConfigRemote?>());
794+
repositoryManagerListener.DidNotReceive().OnLocalBranchListChanged();
795+
repositoryManagerListener.DidNotReceive().OnRemoteBranchListChanged();
796+
repositoryManagerListener.Received().OnIsBusyChanged(Args.Bool);
797+
repositoryManagerListener.DidNotReceive().OnLocksUpdated(Args.EnumerableGitLock);
798+
799+
await RepositoryManager.CheckoutFiles(new List<string>() { "foobar.txt" })
800+
.StartAsAsync();
801+
802+
await TaskManager.Wait();
803+
RepositoryManager.WaitForEvents();
804+
WaitForNotBusy(repositoryManagerEvents, 1);
805+
repositoryManagerEvents.OnStatusUpdate.WaitOne(TimeSpan.FromSeconds(1));
806+
807+
repositoryManagerListener.Received().OnStatusUpdate(Args.GitStatus);
808+
repositoryManagerListener.DidNotReceive().OnActiveBranchChanged(Arg.Any<ConfigBranch?>());
809+
repositoryManagerListener.DidNotReceive().OnActiveRemoteChanged(Arg.Any<ConfigRemote?>());
810+
repositoryManagerListener.DidNotReceive().OnLocalBranchListChanged();
811+
repositoryManagerListener.DidNotReceive().OnRemoteBranchListChanged();
812+
repositoryManagerListener.Received().OnIsBusyChanged(Args.Bool);
813+
repositoryManagerListener.DidNotReceive().OnLocksUpdated(Args.EnumerableGitLock);
814+
815+
result.AssertEqual(expected);
816816

817817
repositoryManagerListener.ClearReceivedCalls();
818818
repositoryManagerEvents.Reset();

0 commit comments

Comments
 (0)