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

Commit 27025ee

Browse files
authored
Merge branch 'master' into fixes/changes-view-refactoring
2 parents bd43ce4 + 9306619 commit 27025ee

File tree

16 files changed

+141
-88
lines changed

16 files changed

+141
-88
lines changed

package.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,29 @@ pushd src
2222
git clean -xdf
2323
popd
2424

25-
if [ -f "$1/Unity.app/Contents/MacOS/Unity" ]; then
26-
Unity="$1/Unity.app/Contents/MacOS/Unity"
27-
elif [ -f $1/Unity ]; then
28-
Unity="$1/Unity"
29-
else
30-
echo "Can't find Unity in $1"
31-
exit 1
32-
fi
33-
3425
OS="Mac"
35-
if [ -e "/c/" ]; then
26+
if [ -e "c:\\" ]; then
3627
OS="Windows"
3728
fi
3829

30+
if [ x"$OS" == x"Windows" ]; then
31+
if [ -f "$1/Editor/Unity.exe" ]; then
32+
Unity="$1/Editor/Unity.exe"
33+
else
34+
echo "Can't find Unity in $1"
35+
exit 1
36+
fi
37+
else
38+
if [ -f "$1/Unity.app/Contents/MacOS/Unity" ]; then
39+
Unity="$1/Unity.app/Contents/MacOS/Unity"
40+
elif [ -f "$1/Unity" ]; then
41+
Unity="$1/Unity"
42+
else
43+
echo "Can't find Unity in $1"
44+
exit 1
45+
fi
46+
fi
47+
3948
if [ x"$OS" == x"Windows" ]; then
4049
common/nuget restore GitHub.Unity.sln
4150
else

src/GitHub.Api/Git/GitClient.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,131 +154,171 @@ public ITask Init(IOutputProcessor<string> processor = null)
154154

155155
public ITask LfsInstall(IOutputProcessor<string> processor = null)
156156
{
157+
Logger.Trace("LfsInstall");
158+
157159
return new GitLfsInstallTask(cancellationToken, processor)
158160
.Configure(processManager);
159161
}
160162

161163
public ITask<GitStatus?> Status(IOutputProcessor<GitStatus?> processor = null)
162164
{
165+
Logger.Trace("Status");
166+
163167
return new GitStatusTask(new GitObjectFactory(environment), cancellationToken, processor)
164168
.Configure(processManager);
165169
}
166170

167171
public ITask<List<GitLogEntry>> Log(BaseOutputListProcessor<GitLogEntry> processor = null)
168172
{
173+
Logger.Trace("Log");
174+
169175
return new GitLogTask(new GitObjectFactory(environment), cancellationToken, processor)
170176
.Configure(processManager);
171177
}
172178

173179
public ITask<string> GetConfig(string key, GitConfigSource configSource, IOutputProcessor<string> processor = null)
174180
{
181+
Logger.Trace("GetConfig");
182+
175183
return new GitConfigGetTask(key, configSource, cancellationToken, processor)
176184
.Configure(processManager);
177185
}
178186

179187
public ITask<string> SetConfig(string key, string value, GitConfigSource configSource, IOutputProcessor<string> processor = null)
180188
{
189+
Logger.Trace("SetConfig");
190+
181191
return new GitConfigSetTask(key, value, configSource, cancellationToken, processor)
182192
.Configure(processManager);
183193
}
184194

185195
public ITask<List<GitLock>> ListLocks(bool local, BaseOutputListProcessor<GitLock> processor = null)
186196
{
197+
Logger.Trace("ListLocks");
198+
187199
return new GitListLocksTask(new GitObjectFactory(environment), local, cancellationToken, processor)
188200
.Configure(processManager);
189201
}
190202

191203
public ITask<string> Pull(string remote, string branch, IOutputProcessor<string> processor = null)
192204
{
205+
Logger.Trace("Pull");
206+
193207
return new GitPullTask(remote, branch, cancellationToken, processor)
194208
.Configure(processManager);
195209
}
196210

197211
public ITask<string> Push(string remote, string branch,
198212
IOutputProcessor<string> processor = null)
199213
{
214+
Logger.Trace("Push");
215+
200216
return new GitPushTask(remote, branch, true, cancellationToken, processor)
201217
.Configure(processManager);
202218
}
203219

204220
public ITask<string> Revert(string changeset, IOutputProcessor<string> processor = null)
205221
{
222+
Logger.Trace("Revert");
223+
206224
return new GitRevertTask(changeset, cancellationToken, processor)
207225
.Configure(processManager);
208226
}
209227

210228
public ITask<string> Fetch(string remote,
211229
IOutputProcessor<string> processor = null)
212230
{
231+
Logger.Trace("Fetch");
232+
213233
return new GitFetchTask(remote, cancellationToken, processor)
214234
.Configure(processManager);
215235
}
216236

217237
public ITask<string> SwitchBranch(string branch, IOutputProcessor<string> processor = null)
218238
{
239+
Logger.Trace("SwitchBranch");
240+
219241
return new GitSwitchBranchesTask(branch, cancellationToken, processor)
220242
.Configure(processManager);
221243
}
222244

223245
public ITask<string> DeleteBranch(string branch, bool deleteUnmerged = false,
224246
IOutputProcessor<string> processor = null)
225247
{
248+
Logger.Trace("DeleteBranch");
249+
226250
return new GitBranchDeleteTask(branch, deleteUnmerged, cancellationToken, processor)
227251
.Configure(processManager);
228252
}
229253

230254
public ITask<string> CreateBranch(string branch, string baseBranch,
231255
IOutputProcessor<string> processor = null)
232256
{
257+
Logger.Trace("CreateBranch");
258+
233259
return new GitBranchCreateTask(branch, baseBranch, cancellationToken, processor)
234260
.Configure(processManager);
235261
}
236262

237263
public ITask<string> RemoteAdd(string remote, string url,
238264
IOutputProcessor<string> processor = null)
239265
{
266+
Logger.Trace("RemoteAdd");
267+
240268
return new GitRemoteAddTask(remote, url, cancellationToken, processor)
241269
.Configure(processManager);
242270
}
243271

244272
public ITask<string> RemoteRemove(string remote,
245273
IOutputProcessor<string> processor = null)
246274
{
275+
Logger.Trace("RemoteRemove");
276+
247277
return new GitRemoteRemoveTask(remote, cancellationToken, processor)
248278
.Configure(processManager);
249279
}
250280

251281
public ITask<string> RemoteChange(string remote, string url,
252282
IOutputProcessor<string> processor = null)
253283
{
284+
Logger.Trace("RemoteChange");
285+
254286
return new GitRemoteChangeTask(remote, url, cancellationToken, processor)
255287
.Configure(processManager);
256288
}
257289

258290
public ITask<string> Commit(string message, string body,
259291
IOutputProcessor<string> processor = null)
260292
{
293+
Logger.Trace("Commit");
294+
261295
return new GitCommitTask(message, body, cancellationToken, processor)
262296
.Configure(processManager);
263297
}
264298

265299
public ITask<string> Add(IList<string> files,
266300
IOutputProcessor<string> processor = null)
267301
{
302+
Logger.Trace("Add");
303+
268304
return new GitAddTask(files, cancellationToken, processor)
269305
.Configure(processManager);
270306
}
271307

272308
public ITask<string> Remove(IList<string> files,
273309
IOutputProcessor<string> processor = null)
274310
{
311+
Logger.Trace("Remove");
312+
275313
return new GitRemoveFromIndexTask(files, cancellationToken, processor)
276314
.Configure(processManager);
277315
}
278316

279317
public ITask<string> AddAndCommit(IList<string> files, string message, string body,
280318
IOutputProcessor<string> processor = null)
281319
{
320+
Logger.Trace("AddAndCommit");
321+
282322
return Add(files)
283323
.Then(new GitCommitTask(message, body, cancellationToken)
284324
.Configure(processManager));
@@ -287,13 +327,17 @@ public ITask<string> AddAndCommit(IList<string> files, string message, string bo
287327
public ITask<string> Lock(string file,
288328
IOutputProcessor<string> processor = null)
289329
{
330+
Logger.Trace("Lock");
331+
290332
return new GitLockTask(file, cancellationToken, processor)
291333
.Configure(processManager);
292334
}
293335

294336
public ITask<string> Unlock(string file, bool force,
295337
IOutputProcessor<string> processor = null)
296338
{
339+
Logger.Trace("Unlock");
340+
297341
return new GitUnlockTask(file, force, cancellationToken, processor)
298342
.Configure(processManager);
299343
}

src/GitHub.Api/Git/IRepository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ interface IRepository : IEquatable<IRepository>
5252
IUser User { get; set; }
5353
IEnumerable<GitLock> CurrentLocks { get; }
5454

55-
event Action<GitStatus> OnRepositoryChanged;
55+
event Action<GitStatus> OnStatusUpdated;
5656
event Action<string> OnActiveBranchChanged;
5757
event Action<string> OnActiveRemoteChanged;
5858
event Action OnLocalBranchListChanged;
59-
event Action OnCommitChanged;
59+
event Action OnHeadChanged;
6060
event Action<IEnumerable<GitLock>> OnLocksUpdated;
6161
}
6262
}

src/GitHub.Api/Git/Repository.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class Repository : IRepository, IEquatable<Repository>
1313
private readonly IGitClient gitClient;
1414
private readonly IRepositoryManager repositoryManager;
1515

16-
public event Action<GitStatus> OnRepositoryChanged;
16+
public event Action<GitStatus> OnStatusUpdated;
1717
public event Action<string> OnActiveBranchChanged;
1818
public event Action<string> OnActiveRemoteChanged;
1919
public event Action OnLocalBranchListChanged;
20-
public event Action OnCommitChanged;
20+
public event Action OnHeadChanged;
2121
public event Action<IEnumerable<GitLock>> OnLocksUpdated;
2222

2323
public IEnumerable<GitBranch> LocalBranches => repositoryManager.LocalBranches.Values.Select(
@@ -46,7 +46,7 @@ public Repository(IGitClient gitClient, IRepositoryManager repositoryManager, st
4646
CloneUrl = cloneUrl;
4747
LocalPath = localPath;
4848

49-
repositoryManager.OnRepositoryChanged += RepositoryManager_OnRepositoryChanged;
49+
repositoryManager.OnStatusUpdated += RepositoryManager_OnStatusUpdated;
5050
repositoryManager.OnActiveBranchChanged += RepositoryManager_OnActiveBranchChanged;
5151
repositoryManager.OnActiveRemoteChanged += RepositoryManager_OnActiveRemoteChanged;
5252
repositoryManager.OnLocalBranchListChanged += RepositoryManager_OnLocalBranchListChanged;
@@ -125,7 +125,7 @@ private void RepositoryManager_OnRemoteOrTrackingChanged()
125125

126126
private void RepositoryManager_OnHeadChanged()
127127
{
128-
OnCommitChanged?.Invoke();
128+
OnHeadChanged?.Invoke();
129129
}
130130

131131
private void RepositoryManager_OnLocalBranchListChanged()
@@ -143,11 +143,10 @@ private void RepositoryManager_OnActiveBranchChanged()
143143
OnActiveBranchChanged?.Invoke(CurrentBranch);
144144
}
145145

146-
private void RepositoryManager_OnRepositoryChanged(GitStatus status)
146+
private void RepositoryManager_OnStatusUpdated(GitStatus status)
147147
{
148148
CurrentStatus = status;
149-
//Logger.Debug("Got STATUS 2 {0} {1}", OnRepositoryChanged, status);
150-
OnRepositoryChanged?.Invoke(CurrentStatus);
149+
OnStatusUpdated?.Invoke(CurrentStatus);
151150
}
152151

153152
private void RepositoryManager_OnLocksUpdated(IEnumerable<GitLock> locks)

0 commit comments

Comments
 (0)