Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
351 commits
Select commit Hold shift + click to select a range
1f32865
Tweak the message to be clearer
shana Oct 19, 2017
fffc9f0
Add OSX instructions
shana Oct 19, 2017
10fdab0
Merge pull request #348 from mpOzelot/patch-1
shana Oct 19, 2017
b4196e2
Merge branch 'master' into fixes/initialize-project-requires-name-email
StanleyGoldman Oct 19, 2017
adf0d22
Merge branch 'master' into fixes/cleanup
StanleyGoldman Oct 19, 2017
229134f
Fixes needed after merge
StanleyGoldman Oct 19, 2017
23498ce
Turning messages into constants; Changing account refresh message
StanleyGoldman Oct 19, 2017
c03a55d
Merge branch 'master' into fixes/api-failure-switch-auth-view
StanleyGoldman Oct 19, 2017
e00c98c
Returning the exception message
StanleyGoldman Oct 19, 2017
33fb66b
Removing unused overloads and calls
StanleyGoldman Oct 19, 2017
537d7c6
Merge branch 'master' into fixes/init-view-bugs
StanleyGoldman Oct 19, 2017
9fddb07
Merge branch 'master' into fixes/we-like-exceptions
StanleyGoldman Oct 19, 2017
75989da
Merge pull request #333 from github-for-unity/fixes/we-like-exceptions
StanleyGoldman Oct 19, 2017
01870e0
Merge branch 'master' into fixes/cleanup
StanleyGoldman Oct 19, 2017
5e02c39
Merge branch 'master' into fixes/initialize-project-requires-name-email
StanleyGoldman Oct 19, 2017
2ba066f
Combined function to retrieve git name and email
StanleyGoldman Oct 19, 2017
3ac90e5
Cleaning up log messages
StanleyGoldman Oct 19, 2017
7cf80c0
treeLocals is never null
StanleyGoldman Oct 20, 2017
99c4ed2
Adding branchesHasChanged flag to signal rebuild of tree
StanleyGoldman Oct 20, 2017
13fcec0
Adding missing reset of branchesHasChanged
StanleyGoldman Oct 20, 2017
a3d978a
Updating readme to include 2017.1 as a supported version
StanleyGoldman Oct 20, 2017
4a11234
Merge pull request #379 from github-for-unity/documentation/update-re…
shana Oct 20, 2017
3a22ba4
Merge branch 'master' into fixes/cleanup
shana Oct 20, 2017
bac56f2
Merge pull request #375 from github-for-unity/fixes/cleanup
shana Oct 20, 2017
336deda
Merge branch 'master' into fixes/init-view-bugs
shana Oct 20, 2017
dfd1b5d
Merge branch 'master' into fixes/initialize-project-requires-name-email
shana Oct 20, 2017
2987c08
Merge pull request #376 from github-for-unity/fixes/init-view-bugs
StanleyGoldman Oct 20, 2017
a9b9432
Merge branch 'master' into fixes/initialize-project-requires-name-email
StanleyGoldman Oct 20, 2017
13b562c
Temporaily disabling integration test that incorrectly fails often
StanleyGoldman Oct 20, 2017
99ca3a0
Merge branch 'master' into fixes/disable-integration-test
StanleyGoldman Oct 20, 2017
e19c891
Fixing error after merge
StanleyGoldman Oct 20, 2017
090f950
Merge pull request #319 from github-for-unity/fixes/initialize-projec…
StanleyGoldman Oct 20, 2017
896dae9
Merge branch 'master' into features/cache-manager
StanleyGoldman Oct 20, 2017
f55b9d8
Updating branch cache on branch change
StanleyGoldman Oct 20, 2017
466507f
Removing stray newline
StanleyGoldman Oct 20, 2017
f37f2b0
Merge branch 'features/cache-manager' into stanley/branches-view-fixes
StanleyGoldman Oct 20, 2017
289038d
Initializing BranchCache
StanleyGoldman Oct 20, 2017
560fc55
Merge branch 'features/cache-manager' into stanley/branches-view-fixes
StanleyGoldman Oct 20, 2017
4cabc10
Removing initialize of BranchCache from BranchView
StanleyGoldman Oct 20, 2017
91f919d
Migrating GitLogCache to CacheManager
StanleyGoldman Oct 20, 2017
f0083d9
Adding some logging for sanity
StanleyGoldman Oct 20, 2017
f8c951e
Unintentional class move
StanleyGoldman Oct 20, 2017
fcf8667
Undoing more unintentional change
StanleyGoldman Oct 20, 2017
a873155
Merge branch 'master' into fixes/long-publish-error-message
StanleyGoldman Oct 23, 2017
97273c4
Merge master into fixes/api-failure-switch-auth-view
Oct 23, 2017
80e392b
Restoring code to change the error message
StanleyGoldman Oct 23, 2017
2dad144
Adding another constant for text
StanleyGoldman Oct 23, 2017
c14fb8d
Merge pull request #361 from github-for-unity/fixes/long-publish-erro…
shana Oct 23, 2017
a2859d1
Merge master into fixes/api-failure-switch-auth-view
Oct 23, 2017
85969ad
Preventing the exposure of Octokit objects to the codebase
StanleyGoldman Oct 23, 2017
1c2ac4d
Merge branch 'master' into ui/initialize-workflow
StanleyGoldman Oct 24, 2017
7b7b3e9
Fix needed after merge
StanleyGoldman Oct 24, 2017
b339b34
Adjust some spacing for empty state
donokuda Oct 25, 2017
0fd147a
Adding cache managers and making use of the RepositoryInfoCacheManage…
StanleyGoldman Oct 25, 2017
55038c9
Increasing timeout
StanleyGoldman Oct 25, 2017
b3fafd8
Firing events on the main thread
StanleyGoldman Oct 25, 2017
360851a
Figuring out a base class sytem that works for these cache objects
StanleyGoldman Oct 25, 2017
41b9d4e
More space adjustments
donokuda Oct 25, 2017
6819d7f
Try out a different kind of error message
donokuda Oct 25, 2017
87ec22d
Center text
donokuda Oct 26, 2017
748c126
Using this new base class
StanleyGoldman Oct 26, 2017
f00b333
Removing more test cache code
StanleyGoldman Oct 26, 2017
952a142
Removing last instance of that test cache object
StanleyGoldman Oct 26, 2017
7f4428e
Setting default value on lastUpdated and lastVerified values
StanleyGoldman Oct 26, 2017
ffd2f1b
Renaming some variables
StanleyGoldman Oct 26, 2017
6482545
:fire: extra cruft from auth view
donokuda Oct 26, 2017
58b48aa
Use a HelpBox instead
donokuda Oct 26, 2017
60528e7
Removing the extra InitializeRepository call
StanleyGoldman Oct 26, 2017
89936f7
Merge branch 'fixes/application-cache-double-call' into features/cach…
StanleyGoldman Oct 26, 2017
2f38e6a
Merge pull request #388 from github-for-unity/fixes/application-cache…
shana Oct 26, 2017
76aa8a9
Merge branch 'master' into features/cache-manager
StanleyGoldman Oct 26, 2017
144da6c
Moving where CacheContainer is created and how it gets into Repository
StanleyGoldman Oct 26, 2017
20e137a
Adjust some spacing
donokuda Oct 26, 2017
9eea8a6
Changing how the cache items are created
StanleyGoldman Oct 26, 2017
181ca0a
Missing save in base class
StanleyGoldman Oct 26, 2017
41b105f
Renaming file
StanleyGoldman Oct 26, 2017
1b7862b
Changing the struct GitBranch to use a default constructor and fields
StanleyGoldman Oct 27, 2017
e2d1c7f
Merge branch 'fixes/oh-my-struct-constructor' into features/cache-man…
StanleyGoldman Oct 27, 2017
14a1a83
Using default values for structs correctly
StanleyGoldman Oct 27, 2017
86530ac
Removing reset during invalidation
StanleyGoldman Oct 27, 2017
5e1879a
Kneecapping data timeout
StanleyGoldman Oct 27, 2017
f6da8bd
Merge branch 'features/cache-manager' into features/using-cache-manager
StanleyGoldman Oct 27, 2017
08c566d
Disabling RepositoryManagerTests
StanleyGoldman Oct 27, 2017
a20de1e
Disabling RepositoryTests as well
StanleyGoldman Oct 27, 2017
dc7b426
Merge branch 'features/cache-manager' into features/using-cache-manager
StanleyGoldman Oct 27, 2017
9510e89
Refactoring Window.MaybeUpdateData
StanleyGoldman Oct 27, 2017
6a832a9
Merge branch 'fixes/window-maybe-update-data' into features/using-cac…
StanleyGoldman Oct 27, 2017
4407481
Starting to add an event to represent cache changes from the Repository
StanleyGoldman Oct 27, 2017
aa92bf0
Cleaning up this logic
StanleyGoldman Oct 27, 2017
fc97337
Merge branch 'fixes/window-maybe-update-data' into features/using-cac…
StanleyGoldman Oct 27, 2017
a977870
Logic error
StanleyGoldman Oct 27, 2017
7e78331
Merge branch 'fixes/window-maybe-update-data' into features/using-cac…
StanleyGoldman Oct 27, 2017
8b260dd
Remove unneeded spacing
donokuda Oct 27, 2017
1b9b470
Integrating the few Window displays with the cache notification system
StanleyGoldman Oct 27, 2017
54c55aa
Changing a nullable GitStatus operations to non nullable
StanleyGoldman Oct 27, 2017
e558ee9
Merge branch 'fixes/git-status-output-processor' into features/using-…
StanleyGoldman Oct 27, 2017
51d37b3
Removing log from CacheContainer constructor
StanleyGoldman Oct 27, 2017
9a9a72e
Merge branch 'features/cache-manager' into features/using-cache-manager
StanleyGoldman Oct 27, 2017
fcb9481
Removing unused logger
StanleyGoldman Oct 27, 2017
8468d9b
Merge branch 'features/cache-manager' into features/using-cache-manager
StanleyGoldman Oct 27, 2017
aca3663
Attaching and detaching handlers at the right time
StanleyGoldman Oct 27, 2017
948fd8a
Merge branch 'fixes/window-child-view-attach' into features/using-cac…
StanleyGoldman Oct 27, 2017
f99cf46
Making Repository a parameter for DetachHandlers
StanleyGoldman Oct 27, 2017
1569534
Merge branch 'fixes/window-child-view-attach' into features/using-cac…
StanleyGoldman Oct 27, 2017
f57da7a
Populating GitStatus through cache
StanleyGoldman Oct 27, 2017
b933b53
Removing #pragma diable of 649
StanleyGoldman Oct 30, 2017
a07d019
Inline isBusy value of false that is never assigned to
StanleyGoldman Oct 30, 2017
5674b9c
Merge branch 'fixes/what-pragma-warning' into features/using-cache-ma…
StanleyGoldman Oct 30, 2017
2b4dff4
Figuring out a naming convention
StanleyGoldman Oct 30, 2017
463d916
Fixing #351
GalHorowitz Oct 30, 2017
abf7a1a
Merge pull request #1 from GalHorowitz/GalHorowitz-patch-1
GalHorowitz Oct 30, 2017
946ef39
A few renames and converting HistoryView
StanleyGoldman Oct 30, 2017
4750880
Removing branch favorite functionality
StanleyGoldman Oct 30, 2017
51f98ba
Merge branch 'fixes/isolating-favorites' into features/using-cache-ma…
StanleyGoldman Oct 30, 2017
d89006a
Merge pull request #383 from github-for-unity/fixes/disable-integrati…
shana Oct 30, 2017
e71ccf1
Merge branch 'master' into fixes/isolating-favorites
shana Oct 30, 2017
eeb44d1
Removing redundant interfaces
StanleyGoldman Oct 30, 2017
ae253f9
Gross copy pasta error with removing a remote branch
StanleyGoldman Oct 30, 2017
004f031
Merge branch 'master' into fixes/repository-remove-remote-branch
StanleyGoldman Oct 30, 2017
94132f0
Merge branch 'fixes/repository-remove-remote-branch' into features/us…
StanleyGoldman Oct 30, 2017
94e2ab2
Merge branch 'master' into features/using-cache-manager
StanleyGoldman Oct 30, 2017
735dfd9
Removing chain of Refresh that does nothing
StanleyGoldman Oct 30, 2017
d317194
Merge pull request #397 from github-for-unity/fixes/repository-remove…
shana Oct 31, 2017
d961833
Merge pull request #391 from github-for-unity/fixes/window-maybe-upda…
shana Oct 31, 2017
0953865
Merge pull request #394 from github-for-unity/fixes/what-pragma-warning
shana Oct 31, 2017
95315d7
Removing additional unused parts of favorites
StanleyGoldman Oct 31, 2017
4c9ff07
Merge branch 'fixes/isolating-favorites' into features/using-cache-ma…
StanleyGoldman Oct 31, 2017
0165c71
Merge branch 'master' into features/using-cache-manager
StanleyGoldman Oct 31, 2017
4a5f9db
Merge branch 'master' into fixes/isolating-favorites
StanleyGoldman Oct 31, 2017
812bbff
Merge pull request #396 from github-for-unity/fixes/isolating-favorites
shana Oct 31, 2017
fb92b54
Adding SerializableDictionary
StanleyGoldman Oct 31, 2017
31e7af6
Getting branches to work with the cache
StanleyGoldman Oct 31, 2017
5c645cb
Functionality to manage locks
StanleyGoldman Oct 31, 2017
675d364
ChangesView isBusy should default to false
StanleyGoldman Oct 31, 2017
7545af6
Updating git log and status after the current branch is updated
StanleyGoldman Oct 31, 2017
cdae882
Background updates of different caches
StanleyGoldman Oct 31, 2017
d43102d
Updating locks and remotes in SettingsView
StanleyGoldman Oct 31, 2017
034ba9c
Fixing exception message
StanleyGoldman Nov 1, 2017
af3bf88
Making GitLock serializable
StanleyGoldman Nov 1, 2017
84b7e17
Merge branch 'fixes/git-locks-serializable' into features/using-cache…
StanleyGoldman Nov 1, 2017
77dc497
I thought this would work
StanleyGoldman Nov 1, 2017
9898fd9
Proof the values are being set, just not serializing
StanleyGoldman Nov 1, 2017
854b189
A culprit has been discovered
StanleyGoldman Nov 1, 2017
eb4c2d0
Correctly serializing remote branch dictionaries
StanleyGoldman Nov 1, 2017
f81d00f
Restoring RepositoryInfoCache
StanleyGoldman Nov 1, 2017
f726c7f
No need to use the UriString when the string is available
StanleyGoldman Nov 1, 2017
52491d6
Populating repository name and clone uri from cache
StanleyGoldman Nov 1, 2017
dfb571a
Removing RepositoryTests
StanleyGoldman Nov 1, 2017
95613fe
Fixing update bug
StanleyGoldman Nov 1, 2017
a58a212
Merge branch 'master' into stanley/branches-view-fixes
StanleyGoldman Nov 1, 2017
8921bd8
Fixes after merge
StanleyGoldman Nov 1, 2017
3f2d2f9
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 1, 2017
733df51
More fixes after the merge
StanleyGoldman Nov 1, 2017
68a17e3
Merge branch 'master' into master
StanleyGoldman Nov 1, 2017
52f315c
Adding an optimization to usages of cache manager
StanleyGoldman Nov 1, 2017
d5f6d87
Fixing field usage
StanleyGoldman Nov 1, 2017
1d15704
Removing unused field
StanleyGoldman Nov 1, 2017
cc41b22
The relevant data is updated in RepositoryInfoCache not BranchCache
StanleyGoldman Nov 1, 2017
fdd711d
Making GitLock serializable
StanleyGoldman Nov 1, 2017
b292c85
Changing the struct GitBranch to use a default constructor and fields
StanleyGoldman Oct 27, 2017
07ae865
Merge fixes/oh-my-struct-constructor into features/using-cache-manager
shana Nov 2, 2017
b7ed8f8
Merge fixes/git-locks-serializable into features/using-cache-manager
shana Nov 2, 2017
d0f33d1
Merge pull request #389 from github-for-unity/fixes/oh-my-struct-cons…
shana Nov 2, 2017
651a146
Merge pull request #399 from github-for-unity/fixes/git-locks-seriali…
shana Nov 2, 2017
fa99642
Merge master into features/using-cache-manager
shana Nov 2, 2017
4d03791
Fix merge
shana Nov 2, 2017
90535f2
Move CacheContainer into environment and use a mock for the tests
shana Nov 2, 2017
cafb7e7
Merge pull request #386 from github-for-unity/fixes/api-client-octoki…
shana Nov 2, 2017
58cb052
AuthenticationView can handle its own message logic
shana Nov 2, 2017
3709d52
Resetting the UI when going back or finishing
shana Nov 2, 2017
209de48
Merge pull request #400 from github-for-unity/fixes/auth-view-cleanup
StanleyGoldman Nov 2, 2017
788118b
Merge branch 'master' into fixes/api-failure-switch-auth-view
StanleyGoldman Nov 2, 2017
18c19df
Adding events to repository that better represent the values that are…
StanleyGoldman Nov 2, 2017
6af5853
Updating log messages
StanleyGoldman Nov 2, 2017
742a1a3
Isolating cache access to properties
StanleyGoldman Nov 2, 2017
f0f57cb
Removing OnRepositoryChanged
StanleyGoldman Nov 2, 2017
5fbc0fd
Merge branch 'fixes/window-child-view-attach' into features/using-cac…
StanleyGoldman Nov 2, 2017
474dcc7
Changing the title content when the view changes
StanleyGoldman Nov 2, 2017
16031fe
Firing OnEnable when we switch the ActiveView
StanleyGoldman Nov 2, 2017
d0c6426
Calling Redraw when we switch the ActiveView
StanleyGoldman Nov 2, 2017
8c6cdfa
Redraw after organizations are loaded
StanleyGoldman Nov 2, 2017
b108e06
Changing the log output for KeychainEmptyException
StanleyGoldman Nov 2, 2017
149ea4c
Merge branch 'master' into fixes/window-child-view-attach
StanleyGoldman Nov 2, 2017
1064594
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 2, 2017
5e87e9a
Removing unused code
StanleyGoldman Nov 2, 2017
684659d
Removing some unused constant strings
StanleyGoldman Nov 2, 2017
72f6432
Removing some unused references to favorites
StanleyGoldman Nov 2, 2017
daed451
Removing unused function parameters
StanleyGoldman Nov 2, 2017
2a6e2dd
Data hiding
StanleyGoldman Nov 2, 2017
18779df
Following struct with Default pattern in GitRemote
StanleyGoldman Nov 2, 2017
9e7a370
Utilizing struct defaults
StanleyGoldman Nov 2, 2017
30dd822
Fixing errors caused by the changes to GitRemote
StanleyGoldman Nov 2, 2017
29116a6
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 2, 2017
e372d13
More fixes around GitRemote
StanleyGoldman Nov 2, 2017
8dfe36a
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 2, 2017
33f6e9f
Fixing unit tests
StanleyGoldman Nov 2, 2017
d402c55
Update to Git LFS 2.3.4
StanleyGoldman Nov 2, 2017
5888025
Updating unit test
StanleyGoldman Nov 2, 2017
01736cb
Fixing unit test
StanleyGoldman Nov 2, 2017
0ab5306
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 2, 2017
73858ea
Merge branch 'features/using-cache-manager' into fixes/repository-wit…
StanleyGoldman Nov 2, 2017
59b5a23
Ooops we should be looking at the 64 bit location for the Unity dlls too
shana Nov 2, 2017
f459f80
Merge pull request #404 from github-for-unity/fixes/use-x64-unity-dlls
StanleyGoldman Nov 2, 2017
ddef25a
Merge pull request #402 from github-for-unity/fixes/git-lfs-2-3-4
shana Nov 3, 2017
f810561
Merge pull request #393 from github-for-unity/fixes/window-child-view…
shana Nov 3, 2017
46b21df
Merge pull request #392 from github-for-unity/fixes/git-status-output…
shana Nov 3, 2017
4d44b46
Code cleanup
StanleyGoldman Nov 3, 2017
4a3db62
Preventing render if there are no nodes
StanleyGoldman Nov 3, 2017
ffe5027
Removing redundant variable
StanleyGoldman Nov 3, 2017
9fca98c
Combining RepositoryManager OnCurrentBranchUpdated & OnCurrentRemoteU…
StanleyGoldman Nov 3, 2017
4009c55
Doing the same view switching logic that Window has
shana Nov 3, 2017
1fb2034
Relayout code
shana Nov 3, 2017
4280ed4
Merge pull request #300 from github-for-unity/fixes/api-failure-switc…
shana Nov 3, 2017
2d1aa12
Work around the ABI breakage
shana Nov 1, 2017
6321788
Merge pull request #395 from GalHorowitz/master
shana Nov 3, 2017
615955f
Merge pull request #407 from github-for-unity/fixes/repository-manage…
shana Nov 6, 2017
2efa02f
Merge pull request #401 from github-for-unity/fixes/repository-with-b…
shana Nov 6, 2017
c2e14c5
Changing RepositoryManager OnLocalBranchListUpdated and OnRemoteBranc…
StanleyGoldman Nov 6, 2017
1dc8762
Removing main thread wrapper
StanleyGoldman Nov 6, 2017
1b27c29
Making property setters private
StanleyGoldman Nov 6, 2017
48564ff
Moving Repository events to the top of the file
StanleyGoldman Nov 6, 2017
37e78a7
Moving Then and Start calls to separate lines
StanleyGoldman Nov 6, 2017
a3f3658
Corrected method name spelling
StanleyGoldman Nov 6, 2017
efc90b6
Moving private methods after public methods
StanleyGoldman Nov 6, 2017
c29492c
Fixing spacing issue
StanleyGoldman Nov 6, 2017
bae6029
Moving the property value check to the main thread
StanleyGoldman Nov 6, 2017
f28a24b
Removing unneccessary flag
StanleyGoldman Nov 6, 2017
58a1e09
Merge branch 'master' into features/using-cache-manager
StanleyGoldman Nov 6, 2017
aff4698
Moving method
StanleyGoldman Nov 6, 2017
d64f2cd
Grouping fields
StanleyGoldman Nov 6, 2017
04b03fc
Moving methods
StanleyGoldman Nov 6, 2017
3eb968c
Some code formatting
StanleyGoldman Nov 6, 2017
0938eda
Organizing HistoryView
StanleyGoldman Nov 6, 2017
dbbc878
Organizing SettingsView
StanleyGoldman Nov 6, 2017
3ae8c94
Making fields public so they can be serialized
StanleyGoldman Nov 6, 2017
9e39cb4
Removing readonly on GitRemote.token
StanleyGoldman Nov 6, 2017
1528234
Populating name if null
StanleyGoldman Nov 6, 2017
1740385
Merge branch 'features/using-cache-manager' into stanley/branches-vie…
StanleyGoldman Nov 6, 2017
0b96c44
Fixes needed after merge
StanleyGoldman Nov 6, 2017
f15a295
Cleanup GitRemote class
shana Nov 7, 2017
08705a7
Format SerializableDictionary according to our coding style
shana Nov 7, 2017
34b2cc8
Merge pull request #390 from github-for-unity/features/using-cache-ma…
StanleyGoldman Nov 7, 2017
09e8c64
Merge branch 'master' into ui/initialize-workflow
StanleyGoldman Nov 7, 2017
76a11f7
Removing UserSettingsView and GitPathView from InitProjectView
StanleyGoldman Nov 7, 2017
fbd8f99
Hiding error is user data is present
StanleyGoldman Nov 7, 2017
812f974
Formatting some code
StanleyGoldman Nov 7, 2017
99ab542
Cleaning up messages
StanleyGoldman Nov 7, 2017
39eb5da
Changing how InitProjectView updates itself
StanleyGoldman Nov 7, 2017
985c390
Merge pull request #387 from github-for-unity/ui/initialize-workflow
shana Nov 8, 2017
532621b
Merge branch 'master' into stanley/branches-view-fixes
StanleyGoldman Nov 9, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions GitHub.Unity.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EUnitTestFramework_002ESettings_002EMigrations_002ERemoveBuildPolicyAlwaysMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/UnitTesting/ShadowCopy/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionDefault/PlatformType/@EntryValue">x64</s:String>
</wpf:ResourceDictionary>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ The GitHub for Unity extension brings [Git](https://git-scm.com/) and GitHub int

### Requirements

- Unity 5.4-5.6
- We've only tested the extension so far on Unity 5.4 to 5.6. There's currently an blocker issue opened for 5.3 support, so we know it doesn't run there. There are some issues for 2017.x, so it may or may not run well on that version. Personal edition is fine.
- Unity 5.4-2017.1
- We've only tested the extension so far on Unity 5.4 to 2017.1. There's currently an blocker issue opened for 5.3 support, so we know it doesn't run there. There are some issues for 2017.2, so it may or may not run well on that version. Personal edition is fine.
- Git and Git LFS 2.x

#### Git on macOS
Expand Down
1 change: 1 addition & 0 deletions common/properties.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<UnityDir Condition="$(UnityDir) == '' and Exists('$(SolutionDir)\script\lib\UnityEditor.dll')">$(SolutionDir)\script\lib\</UnityDir>
<UnityDir Condition="$(UnityDir) == '' and Exists('$(SolutionDir)\lib\UnityEditor.dll')">$(SolutionDir)\lib\</UnityDir>
<UnityDir Condition="$(UnityDir) == '' and Exists('C:\Program Files\Unity\Editor\Data\Managed\UnityEditor.dll')">C:\Program Files\Unity\Editor\Data\Managed\</UnityDir>
<UnityDir Condition="$(UnityDir) == '' and Exists('C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEditor.dll')">C:\Program Files (x86)\Unity\Editor\Data\Managed\</UnityDir>
<UnityDir Condition="$(UnityDir) == '' and Exists('\Applications\Unity\Unity.app\Contents\Managed\UnityEditor.dll')">\Applications\Unity\Unity.app\Contents\Managed\</UnityDir>
<BuildConfig Condition=" '$(BuildConfig)' == '' ">Debug</BuildConfig>
Expand Down
8 changes: 4 additions & 4 deletions docs/contributing/how-to-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ This repository is LFS-enabled. To clone it, you should use a git client that su
- Visual Studio 2015+ or Mono 4.x + bash shell (git bash).
- Mono 5.x will not work
- `UnityEngine.dll` and `UnityEditor.dll`.
- If you've installed Unity in the default location of `C:\Program Files\Unity` or `C:\Program Files (x86)\Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from your Unity installation into the `lib` directory in order for the build to work
- If you've installed Unity in the default location of `C:\Program Files\Unity` or `C:\Program Files (x86)\Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from `[Unity installation path]\Unity\Editor\Data\Managed` into the `lib` directory in order for the build to work

### MacOS

- Mono 4.x required.
- Mono 5.x will not work
- `UnityEngine.dll` and `UnityEditor.dll`.
- If you've installed Unity in the default location of `/Applications/Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from your Unity installation into the `lib` directory in order for the build to work
- If you've installed Unity in the default location of `/Applications/Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from `[Unity installation path]/Unity.app/Contents/Managed` into the `lib` directory in order for the build to work

## How to Build

Expand All @@ -40,11 +40,11 @@ To be able to authenticate in GitHub for Unity, you'll need to:
- [Register a new developer application](https://github.com/settings/developers) in your profile.
- Copy [common/ApplicationInfo_Local.cs-example](../../common/ApplicationInfo_Local.cs-example) to `common/ApplicationInfo_Local.cs` and fill out the clientId/clientSecret fields for your application.

The build needs to reference `UnityEngine.dll` and `UnityEditor.dll`. These DLLs are included with Unity. If you've installed Unity in the default location, the build will be able to find them automatically. If not, copy these DLLs from your Unity installation into the `lib` directory in order for the build to work.
The build needs to reference `UnityEngine.dll` and `UnityEditor.dll`. These DLLs are included with Unity. If you've installed Unity in the default location, the build will be able to find them automatically. If not, copy these DLLs from `[your Unity installation path]\Unity\Editor\Data\Managed` into the `lib` directory in order for the build to work.

### Visual Studio

To build with Visual Studio 2015 open the solution file `GitHub.Unity.sln`. Select `Build Solution` in the `Build` menu.
To build with Visual Studio 2015+, open the solution file `GitHub.Unity.sln`. Select `Build Solution` in the `Build` menu.

### Mono and Bash (windows and mac)

Expand Down
167 changes: 104 additions & 63 deletions src/GitHub.Api/Application/ApiClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Octokit;

Expand All @@ -20,20 +19,13 @@ public static IApiClient Create(UriString repositoryUrl, IKeychain keychain)
new GitHubClient(AppConfiguration.ProductHeader, credentialStore, hostAddress.ApiUri));
}

private static readonly Unity.ILogging logger = Unity.Logging.GetLogger<ApiClient>();
private static readonly ILogging logger = Logging.GetLogger<ApiClient>();
public HostAddress HostAddress { get; }
public UriString OriginalUrl { get; }

private readonly IKeychain keychain;
private readonly IGitHubClient githubClient;
private readonly ILoginManager loginManager;
private static readonly SemaphoreSlim sem = new SemaphoreSlim(1);

IList<Organization> organizationsCache;
Octokit.User userCache;

string owner;
bool? isEnterprise;

public ApiClient(UriString hostUrl, IKeychain keychain, IGitHubClient githubClient)
{
Expand All @@ -58,7 +50,7 @@ private async Task LogoutInternal(UriString host)
await loginManager.Logout(host);
}

public async Task CreateRepository(NewRepository newRepository, Action<Octokit.Repository, Exception> callback, string organization = null)
public async Task CreateRepository(NewRepository newRepository, Action<GitHubRepository, Exception> callback, string organization = null)
{
Guard.ArgumentNotNull(callback, "callback");
try
Expand All @@ -72,21 +64,27 @@ public async Task CreateRepository(NewRepository newRepository, Action<Octokit.R
}
}

public async Task GetOrganizations(Action<IList<Organization>> callback)
public async Task GetOrganizations(Action<Organization[]> onSuccess, Action<Exception> onError = null)
{
Guard.ArgumentNotNull(callback, "callback");
var organizations = await GetOrganizationInternal();
callback(organizations);
Guard.ArgumentNotNull(onSuccess, nameof(onSuccess));
await GetOrganizationInternal(onSuccess, onError);
}

public async Task LoadKeychain(Action<bool> callback)
public async Task ValidateCurrentUser(Action onSuccess, Action<Exception> onError = null)
{
Guard.ArgumentNotNull(callback, "callback");
var hasLoadedKeys = await LoadKeychainInternal();
callback(hasLoadedKeys);
Guard.ArgumentNotNull(onSuccess, nameof(onSuccess));
try
{
await ValidateCurrentUserInternal();
onSuccess();
}
catch (Exception e)
{
onError?.Invoke(e);
}
}

public async Task GetCurrentUser(Action<Octokit.User> callback)
public async Task GetCurrentUser(Action<GitHubUser> callback)
{
Guard.ArgumentNotNull(callback, "callback");
var user = await GetCurrentUserInternal();
Expand Down Expand Up @@ -189,29 +187,27 @@ public async Task<bool> ContinueLoginAsync(LoginResult loginResult, Func<LoginRe
return result.Code == LoginResultCodes.Success;
}

private async Task<Octokit.Repository> CreateRepositoryInternal(NewRepository newRepository, string organization)
private async Task<GitHubRepository> CreateRepositoryInternal(NewRepository newRepository, string organization)
{
try
{
logger.Trace("Creating repository");

if (!await LoadKeychainInternal())
{
throw new InvalidOperationException("The keychain did not load");
}
await ValidateKeychain();
await ValidateCurrentUserInternal();

Octokit.Repository repository;
GitHubRepository repository;
if (!string.IsNullOrEmpty(organization))
{
logger.Trace("Creating repository for organization");

repository = await githubClient.Repository.Create(organization, newRepository);
repository = (await githubClient.Repository.Create(organization, newRepository)).ToGitHubRepository();
}
else
{
logger.Trace("Creating repository for user");

repository = await githubClient.Repository.Create(newRepository);
repository = (await githubClient.Repository.Create(newRepository)).ToGitHubRepository();
}

logger.Trace("Created Repository");
Expand All @@ -224,66 +220,78 @@ public async Task<bool> ContinueLoginAsync(LoginResult loginResult, Func<LoginRe
}
}

private async Task<IList<Organization>> GetOrganizationInternal()
private async Task GetOrganizationInternal(Action<Organization[]> onSuccess, Action<Exception> onError = null)
{
try
{
logger.Trace("Getting Organizations");

if (!await LoadKeychainInternal())
{
return new List<Organization>();
}
await ValidateKeychain();
await ValidateCurrentUserInternal();

var organizations = await githubClient.Organization.GetAllForCurrent();

logger.Trace("Obtained {0} Organizations", organizations?.Count.ToString() ?? "NULL");

if (organizations != null)
{
organizationsCache = organizations.ToArray();
var array = organizations.Select(organization => new Organization() {
Name = organization.Name,
Login = organization.Login
}).ToArray();
onSuccess(array);
}
}
catch(Exception ex)
{
logger.Error(ex, "Error Getting Organizations");
throw;
onError?.Invoke(ex);
}

return organizationsCache;
}

private async Task<Octokit.User> GetCurrentUserInternal()
private async Task<GitHubUser> GetCurrentUserInternal()
{
try
{
logger.Trace("Getting Organizations");

if (!await LoadKeychainInternal())
{
return null;
}
logger.Trace("Getting Current User");
await ValidateKeychain();

userCache = await githubClient.User.Current();
return (await githubClient.User.Current()).ToGitHubUser();
}
catch(Exception ex)
catch (KeychainEmptyException)
{
logger.Warning("Keychain is empty");
throw;
}
catch (Exception ex)
{
logger.Error(ex, "Error Getting Current User");
throw;
}
}

private async Task ValidateCurrentUserInternal()
{
logger.Trace("Validating User");

return userCache;
var apiUser = await GetCurrentUserInternal();
var apiUsername = apiUser.Login;

var cachedUsername = keychain.Connections.First().Username;

if (apiUsername != cachedUsername)
{
throw new TokenUsernameMismatchException(cachedUsername, apiUsername);
}
}

private async Task<bool> LoadKeychainInternal()
{
logger.Trace("LoadKeychainInternal");

if (keychain.HasKeys)
{
if (!keychain.NeedsLoad)
{
logger.Trace("LoadKeychainInternal: Has keys does not need load");
logger.Trace("LoadKeychainInternal: Previously Loaded");
return true;
}

Expand All @@ -293,6 +301,8 @@ private async Task<bool> LoadKeychainInternal()
var uriString = keychain.Connections.First().Host;
var keychainAdapter = await keychain.Load(uriString);

logger.Trace("LoadKeychainInternal: Loaded");

return keychainAdapter.OctokitCredentials != Credentials.Anonymous;
}

Expand All @@ -301,23 +311,54 @@ private async Task<bool> LoadKeychainInternal()
return false;
}

public async Task<bool> ValidateCredentials()
private async Task ValidateKeychain()
{
try
if (!await LoadKeychainInternal())
{
var store = keychain.Connect(OriginalUrl);

if (store.OctokitCredentials != Credentials.Anonymous)
{
var credential = store.Credential;
await githubClient.Authorization.CheckApplicationAuthentication(ApplicationInfo.ClientId, credential.Token);
}
throw new KeychainEmptyException();
}
catch
{
return false;
}
return true;
}
}

class GitHubUser
{
public string Name { get; set; }
public string Login { get; set; }
}

class GitHubRepository
{
public string Name { get; set; }
public string CloneUrl { get; set; }
}

class ApiClientException : Exception
{
public ApiClientException()
{ }

public ApiClientException(string message) : base(message)
{ }

public ApiClientException(string message, Exception innerException) : base(message, innerException)
{ }
}

class TokenUsernameMismatchException : ApiClientException
{
public string CachedUsername { get; }
public string CurrentUsername { get; }

public TokenUsernameMismatchException(string cachedUsername, string currentUsername)
{
CachedUsername = cachedUsername;
CurrentUsername = currentUsername;
}
}

class KeychainEmptyException : ApiClientException
{
public KeychainEmptyException()
{ }
}
}
Loading