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
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
3 changes: 3 additions & 0 deletions src/GitHub.Api/Git/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,8 @@ public interface IRepository : IEquatable<IRepository>, IDisposable
event Action<CacheUpdateEvent> LocksChanged;
event Action<CacheUpdateEvent> RemoteBranchListChanged;
event Action<CacheUpdateEvent> LocalAndRemoteBranchListChanged;
ITask RemoteAdd(string remote, string url);
ITask RemoteRemove(string remote);
ITask Push(string remote);
}
}
3 changes: 3 additions & 0 deletions src/GitHub.Api/Git/Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,15 @@ public ITask SetupRemote(string remote, string remoteUrl)
public ITask CommitAllFiles(string message, string body) => repositoryManager.CommitAllFiles(message, body);
public ITask CommitFiles(List<string> files, string message, string body) => repositoryManager.CommitFiles(files, message, body);
public ITask Pull() => repositoryManager.Pull(CurrentRemote.Value.Name, CurrentBranch?.Name);
public ITask Push(string remote) => repositoryManager.Push(remote, CurrentBranch?.Name);
public ITask Push() => repositoryManager.Push(CurrentRemote.Value.Name, CurrentBranch?.Name);
public ITask Fetch() => repositoryManager.Fetch(CurrentRemote.Value.Name);
public ITask Revert(string changeset) => repositoryManager.Revert(changeset);
public ITask RequestLock(string file) => repositoryManager.LockFile(file);
public ITask ReleaseLock(string file, bool force) => repositoryManager.UnlockFile(file, force);
public ITask DiscardChanges(GitStatusEntry[] gitStatusEntry) => repositoryManager.DiscardChanges(gitStatusEntry);
public ITask RemoteAdd(string remote, string url) => repositoryManager.RemoteAdd(remote, url);
public ITask RemoteRemove(string remote) => repositoryManager.RemoteRemove(remote);

public void CheckAndRaiseEventsIfCacheNewer(CacheType cacheType, CacheUpdateEvent cacheUpdateEvent) => cacheContainer.CheckAndRaiseEventsIfCacheNewer(cacheType, cacheUpdateEvent);

Expand Down
6 changes: 3 additions & 3 deletions src/GitHub.Api/Git/RepositoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,19 @@ public ITask Revert(string changeset)
public ITask RemoteAdd(string remote, string url)
{
var task = GitClient.RemoteAdd(remote, url);
return HookupHandlers(task, false);
return HookupHandlers(task, true);
}

public ITask RemoteRemove(string remote)
{
var task = GitClient.RemoteRemove(remote);
return HookupHandlers(task, false);
return HookupHandlers(task, true);
}

public ITask RemoteChange(string remote, string url)
{
var task = GitClient.RemoteChange(remote, url);
return HookupHandlers(task, false);
return HookupHandlers(task, true);
}

public ITask SwitchBranch(string branch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,11 @@ public override void OnGUI()

Logger.Trace("Repository Created");

GitClient.RemoteAdd("origin", repository.CloneUrl)
.Then(GitClient.Push("origin", Repository.CurrentBranch.Value.Name))
.ThenInUI(Finish)
.Start();
Repository.RemoteAdd("origin", repository.CloneUrl)
.Then(Repository.Push("origin"))
.ThenInUI(Finish)
.Start();

}, organization);
}
EditorGUI.EndDisabledGroup();
Expand Down