mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-20 06:33:14 +00:00
cli: in cmd_git_push(), narrow scope of seen_branches
This commit is contained in:
parent
68e696d673
commit
237dd98b87
@ -669,8 +669,8 @@ fn cmd_git_push(
|
|||||||
let mut tx = workspace_command.start_transaction("");
|
let mut tx = workspace_command.start_transaction("");
|
||||||
let tx_description;
|
let tx_description;
|
||||||
let mut branch_updates = vec![];
|
let mut branch_updates = vec![];
|
||||||
let mut seen_branches = hashset! {};
|
|
||||||
if args.all || args.deleted {
|
if args.all || args.deleted {
|
||||||
|
let mut seen_branches = hashset! {};
|
||||||
// TODO: Is it useful to warn about conflicted branches?
|
// TODO: Is it useful to warn about conflicted branches?
|
||||||
for (branch_name, branch_target) in repo.view().branches() {
|
for (branch_name, branch_target) in repo.view().branches() {
|
||||||
if !seen_branches.insert(branch_name.clone()) {
|
if !seen_branches.insert(branch_name.clone()) {
|
||||||
@ -694,6 +694,7 @@ fn cmd_git_push(
|
|||||||
&remote
|
&remote
|
||||||
);
|
);
|
||||||
} else if !args.branch.is_empty() || !args.change.is_empty() || !args.revisions.is_empty() {
|
} else if !args.branch.is_empty() || !args.change.is_empty() || !args.revisions.is_empty() {
|
||||||
|
let mut seen_branches = hashset! {};
|
||||||
for branch_name in &args.branch {
|
for branch_name in &args.branch {
|
||||||
if !seen_branches.insert(branch_name.clone()) {
|
if !seen_branches.insert(branch_name.clone()) {
|
||||||
continue;
|
continue;
|
||||||
@ -815,6 +816,7 @@ fn cmd_git_push(
|
|||||||
if branches.is_empty() {
|
if branches.is_empty() {
|
||||||
return Err(user_error("No current branch."));
|
return Err(user_error("No current branch."));
|
||||||
}
|
}
|
||||||
|
let mut seen_branches = hashset! {};
|
||||||
for (branch_name, branch_target) in branches {
|
for (branch_name, branch_target) in branches {
|
||||||
if !seen_branches.insert(branch_name.clone()) {
|
if !seen_branches.insert(branch_name.clone()) {
|
||||||
continue;
|
continue;
|
||||||
@ -833,7 +835,6 @@ fn cmd_git_push(
|
|||||||
}
|
}
|
||||||
tx_description = format!("push current branch(es) to git remote {}", &remote);
|
tx_description = format!("push current branch(es) to git remote {}", &remote);
|
||||||
}
|
}
|
||||||
drop(seen_branches);
|
|
||||||
|
|
||||||
if branch_updates.is_empty() {
|
if branch_updates.is_empty() {
|
||||||
writeln!(ui, "Nothing changed.")?;
|
writeln!(ui, "Nothing changed.")?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user