Skip to content

Commit

Permalink
git: do not export new ref if racy process created one with the same …
Browse files Browse the repository at this point in the history
…name

Since we've checked the ref doesn't exist in this code path, I think it's
better to not overwrite the existing ref.
  • Loading branch information
yuja committed Sep 5, 2023
1 parent a4dd598 commit 89f1d83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ fn update_git_ref(
} else {
// The branch was added in jj but still doesn't exist in git, so add it
git_repo
.reference(git_ref_name, new_oid, true, "export from jj")
.reference(git_ref_name, new_oid, false, "export from jj")
.map_err(FailedRefExportReason::FailedToSet)?;
}
}
Expand Down

0 comments on commit 89f1d83

Please sign in to comment.