Skip to content

Commit d8fbe1e

Browse files
authored
Merge pull request GitoxideLabs#2114 from EliahKagan/test-ref-storage-newline
Test that loose refs are written with a trailing newline
2 parents dc7343c + df91659 commit d8fbe1e

File tree

1 file changed

+5
-0
lines changed
  • gix-ref/tests/refs/file/transaction/prepare_and_commit/create_or_update

1 file changed

+5
-0
lines changed

gix-ref/tests/refs/file/transaction/prepare_and_commit/create_or_update/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,11 @@ fn packed_refs_are_looked_up_when_checking_existing_values() -> crate::Result {
755755
Some(new_id.as_ref()),
756756
"the new id was written to the loose ref"
757757
);
758+
assert_eq!(
759+
std::fs::read_to_string(store.common_dir_resolved().join("refs/heads/main"))?,
760+
format!("{}\n", new_id.to_hex()),
761+
"the loose ref is stored on disk as the full OID followed by a newline"
762+
);
758763
Ok(())
759764
}
760765

0 commit comments

Comments
 (0)