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

Branch popup #303

Merged
merged 25 commits into from
Oct 9, 2020
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0098b59
Initial implementation
WizardOhio24 Oct 3, 2020
05ed8a2
Fix clippy errors
WizardOhio24 Oct 4, 2020
75ace52
Remove can_create_branch
WizardOhio24 Oct 4, 2020
aa1f25c
Remove From<> in BranchForDisplay
WizardOhio24 Oct 4, 2020
e7c3d33
Add comments
WizardOhio24 Oct 4, 2020
3002a12
Change vim_keys to fix clippy
WizardOhio24 Oct 4, 2020
59d7f09
Fix appearance
WizardOhio24 Oct 5, 2020
5cd7385
Update get_branches_to_display function
WizardOhio24 Oct 8, 2020
970e1d8
Update checkout_branch function
WizardOhio24 Oct 8, 2020
edd7f77
Update select_branch component
WizardOhio24 Oct 8, 2020
b0785fc
Add scopetime to get_branches_to_display
WizardOhio24 Oct 8, 2020
db474f4
Add styling to branch list
WizardOhio24 Oct 8, 2020
4a57b62
Fix clippy warnings
WizardOhio24 Oct 8, 2020
19399a0
Add ... to long commit messages
WizardOhio24 Oct 8, 2020
8a7caa6
switch_to_selected_branch returns result
WizardOhio24 Oct 8, 2020
f453142
Fix long branch names removing commit message
WizardOhio24 Oct 9, 2020
235faa8
Modify checkout to error correctly
WizardOhio24 Oct 9, 2020
8d25dd6
Remove unused imports
WizardOhio24 Oct 9, 2020
64ca407
Add scope_time to checkout_branch
WizardOhio24 Oct 9, 2020
bcc0312
Reset head if the checkout fails
WizardOhio24 Oct 9, 2020
a26853d
Fix error when nothing is changed
WizardOhio24 Oct 9, 2020
7fe2f68
Remove update_branches from app update
WizardOhio24 Oct 9, 2020
317f131
Change blocking items back to number of blocking items
WizardOhio24 Oct 9, 2020
d028c2f
Hide popup on creating branch
WizardOhio24 Oct 9, 2020
34c55d8
Remove ability to create a branch in status
WizardOhio24 Oct 9, 2020
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
9 changes: 7 additions & 2 deletions asyncgit/src/sync/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ pub fn checkout_branch(
// hasn't been committed or stashed, in this case it will Err
let repo = utils::repo(repo_path)?;
let cur_ref = repo.head()?;
if repo.statuses(None)?.is_empty() {
if repo
.statuses(Some(
git2::StatusOptions::new().include_ignored(false),
extrawurst marked this conversation as resolved.
Show resolved Hide resolved
))?
.is_empty()
{
repo.set_head(branch_ref)?;

if let Err(e) = repo.checkout_head(Some(
Expand All @@ -97,7 +102,7 @@ pub fn checkout_branch(
Ok(())
} else {
Err(Error::Generic(
format!("Cannot change branch. There are unstaged/staged changes which have not been committed/stashed. There is {:?} changes preventing checking out a different branch.", repo.statuses(None)?.len() ),
format!("Cannot change branch. There are unstaged/staged changes which have not been committed/stashed. There is {:?} changes preventing checking out a different branch.", repo.statuses(None)?.get(0).unwrap().path().unwrap() ),
WizardOhio24 marked this conversation as resolved.
Show resolved Hide resolved
))
}
}
Expand Down