Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added support for pushing Git commits #12633

Merged
merged 29 commits into from
Jun 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b61ca54
Feature: Support for pushing changes
ferrariofilippo Jun 8, 2023
0a69cc7
Tooltips
ferrariofilippo Jun 9, 2023
7812d9e
Update tooltip
ferrariofilippo Jun 9, 2023
ff2156e
Merge
ferrariofilippo Jun 14, 2023
44ef185
Handle Login
ferrariofilippo Jun 16, 2023
6042916
Merge branch 'main' into Git_Push
ferrariofilippo Jun 16, 2023
0e09857
Merge leftovers
ferrariofilippo Jun 16, 2023
58cc802
Requested Changes
ferrariofilippo Jun 17, 2023
034f86b
Requested Changes
ferrariofilippo Jun 18, 2023
ddb7b5a
Merge branch 'main' into Git_Push
yaira2 Jun 19, 2023
dc635a5
Build pipeline
yaira2 Jun 19, 2023
81e7b0c
Merge branch 'main' into Git_Push
yaira2 Jun 19, 2023
8348eaa
Fix requests
ferrariofilippo Jun 19, 2023
e3d90ff
Device Flow not working
ferrariofilippo Jun 20, 2023
0316d2e
Remove " from token
ferrariofilippo Jun 20, 2023
d1aa133
Bug Fix & Copy Button
ferrariofilippo Jun 20, 2023
cbde437
Copy Button
ferrariofilippo Jun 20, 2023
97189e4
Update Dialog
ferrariofilippo Jun 21, 2023
fe50c5d
Merge branch 'main' into Git_Push
ferrariofilippo Jun 21, 2023
900bffe
Update modal
ferrariofilippo Jun 22, 2023
1b4369b
Icons
yaira2 Jun 26, 2023
077243c
Update StatusBarControl.xaml
yaira2 Jun 26, 2023
2818605
Tweak path
yaira2 Jun 27, 2023
e8993a2
Update PathIcons.xaml
yaira2 Jun 27, 2023
02dab93
Update PathIcons.xaml
yaira2 Jun 27, 2023
e84ed91
Partial Requested Changes
ferrariofilippo Jun 27, 2023
efaba3e
Remaining Requested changes
ferrariofilippo Jun 27, 2023
90eb0be
Merge
ferrariofilippo Jun 27, 2023
09af69e
Update PathIcons.xaml
yaira2 Jun 27, 2023
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
19 changes: 14 additions & 5 deletions src/Files.App/Helpers/GitHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ internal static class GitHelpers
private static readonly PullOptions _pullOptions = new();

private static readonly string _clientId =
#if STORE || STABLE || PREVIEW
"githubclientid.secret"
#else
string.Empty;
#endif
EnvHelpers.GetAppEnvironmentAndLogo().Item1 is AppEnvironment.Store or AppEnvironment.Stable or AppEnvironment.Preview
? "githubclientid.secret"
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
: string.Empty;

private static bool _IsExecutingGitAction;
public static bool IsExecutingGitAction
Expand Down Expand Up @@ -257,6 +255,17 @@ public static async void PullOrigin(string? repositoryPath)
if (signature is null)
return;

var token = CredentialsHelpers.GetPassword(GIT_RESOURCE_NAME, GIT_RESOURCE_USERNAME);
if (!string.IsNullOrWhiteSpace(token))
{
_pullOptions.FetchOptions.CredentialsProvider = (url, user, cred)
=> new UsernamePasswordCredentials
{
Username = signature.Name,
Password = token
};
}

IsExecutingGitAction = true;

try
Expand Down