You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason you get a different hash between Linux and Windows is beacuse the file content is different in your example. When you use writeLines, it writes the line separator with a LF on Unix/Linux and CRLF on Windows, therefore, the hash is different.
If you rewrite the example to use writeChar instead to control the line endings, the hash should be identical between Linux and Windows.
library(git2r)
filename <- tempfile("test-file")
f <- file(filename, "wb")
writeChar(
"x\ty\n1\t1\n2\t2\n3\t3\n4\t4\n5\t5\n6\t6\n7\t7\n8\t8\n9\t9\n10\t10\n11\t11\n12\t12\n13\t13\n14\t14\n15\t15\n16\t16\n17\t17\n18\t18\n19\t19\n20\t20\n21\t21\n22\t22\n23\t23\n24\t24\n25\t25\n26\t26\n",
f,
eos = NULL)
close(f)
hashfile(filename)
Below is a reprex. This causes a bug in the
git2rdata
package when switching between OS (ropensci/git2rdata#49).Output:
1de50dce6d5139f98a8e69d4d45d26ae7d32c64f
3e6fbe383532f4312bd0f5c9f30976f64d00e9cc
Session info on Windows
Session info on Linux
The text was updated successfully, but these errors were encountered: