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

Commit 8c2130c

Browse files
Merge branch 'master' into fixes/update-repository-info
2 parents 88c114e + 64e45bd commit 8c2130c

File tree

15 files changed

+216
-197
lines changed

15 files changed

+216
-197
lines changed

common/SolutionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
namespace System
3232
{
3333
internal static class AssemblyVersionInformation {
34-
internal const string Version = "0.22.0";
34+
internal const string Version = "0.23.0";
3535
}
3636
}

src/GitHub.Api/Git/GitClient.cs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ITask<string> GetConfig(string key, GitConfigSource configSource,
2323
ITask<string> SetConfig(string key, string value, GitConfigSource configSource,
2424
IOutputProcessor<string> processor = null);
2525

26-
ITask<string[]> GetConfigUserAndEmail();
26+
ITask<User> GetConfigUserAndEmail();
2727

2828
ITask<List<GitLock>> ListLocks(bool local,
2929
BaseOutputListProcessor<GitLock> processor = null);
@@ -255,26 +255,28 @@ public ITask<string> SetConfig(string key, string value, GitConfigSource configS
255255
.Configure(processManager);
256256
}
257257

258-
public ITask<string[]> GetConfigUserAndEmail()
258+
public ITask<User> GetConfigUserAndEmail()
259259
{
260260
string username = null;
261261
string email = null;
262262

263-
return GetConfig("user.name", GitConfigSource.User).Then((success, value) => {
264-
if (success)
265-
{
266-
username = value;
267-
}
268-
269-
}).Then(GetConfig("user.email", GitConfigSource.User).Then((success, value) => {
270-
if (success)
271-
{
272-
email = value;
273-
}
274-
})).Then(success => {
275-
Logger.Trace("user.name:{1} user.email:{2}", success, username, email);
276-
return new[] { username, email };
277-
});
263+
return GetConfig("user.name", GitConfigSource.User)
264+
.Then((success, value) => {
265+
if (success)
266+
{
267+
username = value;
268+
}
269+
})
270+
.Then(GetConfig("user.email", GitConfigSource.User)
271+
.Then((success, value) => {
272+
if (success)
273+
{
274+
email = value;
275+
}
276+
})).Then(success => {
277+
Logger.Trace("{0}:{1} {2}:{3}", "user.name", username, "user.email", email);
278+
return new User { Name= username, Email = email };
279+
});
278280
}
279281

280282
public ITask<List<GitLock>> ListLocks(bool local, BaseOutputListProcessor<GitLock> processor = null)

src/GitHub.Api/Git/IRepository.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public interface IRepository : IEquatable<IRepository>
1919
ITask RequestLock(string file);
2020
ITask ReleaseLock(string file, bool force);
2121

22+
void RefreshLog();
23+
void RefreshStatus();
24+
void UpdateConfigData();
2225
void CheckLogChangedEvent(CacheUpdateEvent gitLogCacheUpdateEvent);
2326
void CheckStatusChangedEvent(CacheUpdateEvent cacheUpdateEvent);
2427
void CheckCurrentBranchChangedEvent(CacheUpdateEvent cacheUpdateEvent);

src/GitHub.Api/Git/Repository.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,22 @@ public ITask SetupRemote(string remote, string remoteUrl)
8181

8282
public ITask CommitAllFiles(string message, string body)
8383
{
84-
return repositoryManager.CommitAllFiles(message, body);
84+
return repositoryManager
85+
.CommitAllFiles(message, body)
86+
.Then(() => {
87+
UpdateGitStatus();
88+
UpdateGitLog();
89+
});
8590
}
8691

8792
public ITask CommitFiles(List<string> files, string message, string body)
8893
{
89-
return repositoryManager.CommitFiles(files, message, body);
94+
return repositoryManager
95+
.CommitFiles(files, message, body)
96+
.Then(() => {
97+
UpdateGitStatus();
98+
UpdateGitLog();
99+
});
90100
}
91101

92102
public ITask Pull()
@@ -122,6 +132,21 @@ public ITask ReleaseLock(string file, bool force)
122132
.Then(UpdateLocks);
123133
}
124134

135+
public void RefreshLog()
136+
{
137+
UpdateGitLog();
138+
}
139+
140+
public void RefreshStatus()
141+
{
142+
UpdateGitStatus();
143+
}
144+
145+
public void UpdateConfigData()
146+
{
147+
repositoryManager?.UpdateConfigData();
148+
}
149+
125150
public void CheckLogChangedEvent(CacheUpdateEvent cacheUpdateEvent)
126151
{
127152
var managedCache = cacheContainer.GitLogCache;

src/GitHub.Api/Git/RepositoryManager.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public interface IRepositoryManager : IDisposable
4040
ITask LockFile(string file);
4141
ITask UnlockFile(string file, bool force);
4242
int WaitForEvents();
43+
void UpdateConfigData();
4344

4445
IGitConfig Config { get; }
4546
IGitClient GitClient { get; }
@@ -296,21 +297,17 @@ public ITask UnlockFile(string file, bool force)
296297
return HookupHandlers(task);
297298
}
298299

300+
public void UpdateConfigData()
301+
{
302+
UpdateConfigData(false);
303+
}
304+
299305
private void LoadGitUser()
300306
{
301307
GitClient.GetConfigUserAndEmail()
302-
.Then((success, strings) => {
303-
var username = strings[0];
304-
var email = strings[1];
305-
306-
var user = new User {
307-
Name = username,
308-
Email = email
309-
};
310-
308+
.Then((success, user) => {
311309
Logger.Trace("OnGitUserLoaded: {0}", user);
312310
OnGitUserLoaded?.Invoke(user);
313-
314311
}).Start();
315312
}
316313

src/GitHub.Api/Localization.resx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
4-
Microsoft ResX Schema
5-
3+
<!--
4+
Microsoft ResX Schema
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->
@@ -286,12 +286,12 @@
286286
<value>Branch pushed</value>
287287
</data>
288288
<data name="InitializeRepositoryButtonText" xml:space="preserve">
289-
<value>Initialize repository</value>
289+
<value>Initialize a git repository for this project</value>
290290
</data>
291291
<data name="SwitchBranchTitle" xml:space="preserve">
292292
<value>Switch branch</value>
293293
</data>
294294
<data name="SwitchBranchFailedDescription" xml:space="preserve">
295295
<value>Could not switch to branch {0}</value>
296296
</data>
297-
</root>
297+
</root>

src/UnityExtension/Assets/Editor/GitHub.Unity/GitHub.Unity.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@
151151
<EmbeddedResource Include="IconsAndLogos\dot.png" />
152152
<EmbeddedResource Include="IconsAndLogos\dropdown-list-icon%402x.png" />
153153
<EmbeddedResource Include="IconsAndLogos\dropdown-list-icon.png" />
154+
<EmbeddedResource Include="IconsAndLogos\[email protected]" />
155+
<EmbeddedResource Include="IconsAndLogos\empty-state-init.png" />
154156
<EmbeddedResource Include="IconsAndLogos\favorite-branch-indicator.png" />
155157
<EmbeddedResource Include="IconsAndLogos\git-merge%402x.png" />
156158
<EmbeddedResource Include="IconsAndLogos\git-merge-light%402x.png" />
@@ -207,12 +209,12 @@
207209
</ItemGroup>
208210
<Import Project="..\..\..\..\..\common\nativelibraries.props" />
209211
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
210-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
212+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
211213
Other similar extension points exist, see Microsoft.Common.targets.
212214
<Target Name="BeforeBuild">
213215
</Target>
214216
<Target Name="AfterBuild">
215217
</Target>
216218
-->
217219
<Import Project="..\..\..\..\..\common\build.targets" />
218-
</Project>
220+
</Project>
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Styles.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class Styles
6969
commitFileAreaStyle,
7070
commitButtonStyle,
7171
textFieldStyle,
72+
boldCenteredLabel,
7273
centeredLabel,
7374
commitDescriptionFieldStyle,
7475
toggleMixedStyle,
@@ -94,6 +95,7 @@ class Styles
9495
localCommitIcon,
9596
repoIcon,
9697
lockIcon,
98+
emptyStateInit,
9799
dropdownListIcon;
98100

99101
public static Texture2D GetFileStatusIcon(GitFileStatus status, bool isLocked)
@@ -556,6 +558,22 @@ public static GUIStyle CenteredLabel
556558
}
557559
}
558560

561+
public static GUIStyle BoldCenteredLabel
562+
{
563+
get
564+
{
565+
if (boldCenteredLabel == null)
566+
{
567+
boldCenteredLabel = new GUIStyle(EditorStyles.boldLabel);
568+
boldCenteredLabel.name = "BoldCenteredLabelStyle";
569+
boldCenteredLabel.alignment = TextAnchor.MiddleCenter;
570+
boldCenteredLabel.wordWrap = true;
571+
}
572+
return boldCenteredLabel;
573+
}
574+
}
575+
576+
559577
public static GUIStyle CommitDescriptionFieldStyle
560578
{
561579
get
@@ -787,6 +805,19 @@ public static Texture2D LockIcon
787805
}
788806
}
789807

808+
public static Texture2D EmptyStateInit
809+
{
810+
get
811+
{
812+
if (emptyStateInit == null)
813+
{
814+
emptyStateInit = Utility.GetIcon("empty-state-init.png", "[email protected]");
815+
}
816+
return emptyStateInit;
817+
}
818+
819+
}
820+
790821
public static Texture2D DropdownListIcon
791822
{
792823
get

0 commit comments

Comments
 (0)