mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
refactor: stash selected changes in staged group will apply --staged
paramter for git stash push
(#535)
This commit is contained in:
parent
ad3eec99cf
commit
af099af4d0
3 changed files with 49 additions and 39 deletions
|
@ -14,7 +14,6 @@ namespace SourceGit.ViewModels
|
|||
public bool CanIgnoreUntracked
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public bool IncludeUntracked
|
||||
|
@ -23,10 +22,11 @@ namespace SourceGit.ViewModels
|
|||
set;
|
||||
}
|
||||
|
||||
public StashChanges(Repository repo, List<Models.Change> changes, bool canIgnoreUntracked)
|
||||
public StashChanges(Repository repo, List<Models.Change> changes, bool onlyStaged, bool canIgnoreUntracked)
|
||||
{
|
||||
_repo = repo;
|
||||
_changes = changes;
|
||||
_onlyStaged = onlyStaged;
|
||||
|
||||
CanIgnoreUntracked = canIgnoreUntracked;
|
||||
IncludeUntracked = true;
|
||||
|
@ -56,17 +56,18 @@ namespace SourceGit.ViewModels
|
|||
|
||||
return Task.Run(() =>
|
||||
{
|
||||
new Commands.Stash(_repo.FullPath).Push(jobs, Message);
|
||||
var succ = new Commands.Stash(_repo.FullPath).Push(jobs, Message, _onlyStaged);
|
||||
CallUIThread(() =>
|
||||
{
|
||||
_repo.MarkWorkingCopyDirtyManually();
|
||||
_repo.SetWatcherEnabled(true);
|
||||
});
|
||||
return true;
|
||||
return succ;
|
||||
});
|
||||
}
|
||||
|
||||
private readonly Repository _repo = null;
|
||||
private readonly List<Models.Change> _changes = null;
|
||||
private readonly bool _onlyStaged = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue