mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-14 02:07:22 +03:00
git: mark imported remote-tracking branches as public
This commit is contained in:
parent
4db3d8d3a6
commit
79eecb6119
@ -55,6 +55,11 @@ pub fn import_refs(
|
||||
let commit = store.get_commit(&id).unwrap();
|
||||
tx.add_head(&commit);
|
||||
tx.insert_git_ref(git_ref.name().unwrap().to_string(), id);
|
||||
// For now, we consider all remotes "publishing".
|
||||
// TODO: Make it configurable which remotes are publishing.
|
||||
if git_ref.is_remote() {
|
||||
tx.add_public_head(&commit);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -80,6 +80,8 @@ fn test_import_refs() {
|
||||
.cloned()
|
||||
.collect();
|
||||
assert_eq!(heads_after, expected_heads);
|
||||
let public_heads_after: HashSet<_> = view.public_heads().cloned().collect();
|
||||
assert_eq!(public_heads_after, hashset!(commit_id(&commit5)));
|
||||
assert_eq!(view.git_refs().len(), 4);
|
||||
assert_eq!(
|
||||
view.git_refs().get("refs/heads/main"),
|
||||
|
Loading…
Reference in New Issue
Block a user