commit eff4b972377331c3faf693c81c0b90e0aa8fe60664709c4e3697d427e51a0232 from: Omar Polo date: Sat Nov 7 17:22:44 2026 UTC sync files from diff.git 5d8f044ef31781fd2b1488a2394b9be344c53f7a398d6025cd7fad7b1f42549e always print a tab after the file name the way patch extracts the filename from the '---' and '+++' lines (and also Index: etc, ...) is by breaking at the first white space. If there is a tab though, patch will extract everything up to that tab, including whitespaces. This is how it's possible to patch file with whitespaces in them. It's not possible to patch file with tabs or newlines in their name though, unfortunately. ok stsp on the code; regress fixed afterwards. commit - a0c556f159f44e9a0b012bc912aa5c47f405510a5a2528f57dcad9d8b9dcc9ae commit + eff4b972377331c3faf693c81c0b90e0aa8fe60664709c4e3697d427e51a0232 blob - fdfb062cfddc34893c731ea1265005e08393962bf15d34e260dd5f55be7d3c49 blob + 6d61d3e7ec3b91febea0a7ff206277c57bf4f8d00ac4e717a695e937700a995e --- lib/diff_output_unidiff.c +++ lib/diff_output_unidiff.c @@ -252,7 +252,7 @@ output_unidiff_chunk(struct diff_output_info *outinfo, } if (print_header && !(state->header_printed)) { - rc = fprintf(dest, "--- %s\n", + rc = fprintf(dest, "--- %s\t\n", diff_output_get_label_left(info)); if (rc < 0) return errno; @@ -267,7 +267,7 @@ output_unidiff_chunk(struct diff_output_info *outinfo, return ENOMEM; *typep = DIFF_LINE_MINUS; } - rc = fprintf(dest, "+++ %s\n", + rc = fprintf(dest, "+++ %s\t\n", diff_output_get_label_right(info)); if (rc < 0) return errno; blob - da1f8cb88d39bff4014913b32ab25bfd944c3232b5e508a6ad4278747ca1eec8 blob + 47fec72b207c761116b43aaaca19b42c0c96c04502cf0c3f897ac65f10ec6787 --- regress/cmdline/blame.sh +++ regress/cmdline/blame.sh @@ -580,8 +580,8 @@ EOF diff 63581804340e880bf611c6a4a59eda26c503799f 84451b3ef755f3226d0d79af367632e5f3a830e7 blob - b53ca469a18871cc2f6af334dab25028599c6488 blob + c787aadf05e2afab61bd34976f7349912252e6da ---- got_blame.h -+++ got_blame.h +--- got_blame.h$(printf '\t') ++++ got_blame.h$(printf '\t') @@ -14,5 +14,22 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ @@ -613,8 +613,8 @@ EOF diff 75b7a700d9d14ef8eb902961255212acbedef164 d68a0a7de13af722c55099582019c03240e13320 blob - c787aadf05e2afab61bd34976f7349912252e6da blob + 5255d076c915accf159940978b821d06803ff2f8 ---- got_blame.h -+++ got_blame.h +--- got_blame.h$(printf '\t') ++++ got_blame.h$(printf '\t') @@ -28,6 +28,15 @@ const struct got_error *got_blame(const char *, struct * The callback receives the provided void * argument, the total number * of lines of the annotated file, a line number, and the ID of the commit @@ -639,8 +639,8 @@ EOF diff 3f60a8ef49086101685260fcb829f578cdf6d320 3bf198ba335fa30c8d16efb5c8e496200ac99c05 blob - 5255d076c915accf159940978b821d06803ff2f8 blob + 39623c468e733ee08abb50eafe29202b2b0a04ef ---- got_blame.h -+++ got_blame.h +--- got_blame.h$(printf '\t') ++++ got_blame.h$(printf '\t') @@ -30,8 +30,8 @@ const struct got_error *got_blame(const char *, struct * which last changed this line. * @@ -660,8 +660,8 @@ EOF diff 28315671b93d195163b0468fcb3879e29b25759c e27a7222faaa171dcb086ea0b566dc7bebb74a0b blob - 39623c468e733ee08abb50eafe29202b2b0a04ef blob + 6075cadbd177e1802679c7353515bf4ceebb51d0 ---- got_blame.h -+++ got_blame.h +--- got_blame.h$(printf '\t') ++++ got_blame.h$(printf '\t') @@ -15,14 +15,7 @@ */ blob - 1d2fa7217f09745c242d8a780c73bfe12b322e7cf517f1ab91e7253d375ac8a5 blob + 1b7cb326f0db18aed75a247ed89a9c510bf371fc05c5cacb670e867d93bdf3cf --- regress/cmdline/cherrypick.sh +++ regress/cmdline/cherrypick.sh @@ -1363,8 +1363,8 @@ EOF fi cat > $testroot/diff.expected <> $testroot/stdout.expected got tree -r $testroot/repo -c $commit2 -i gamma | grep 'delta$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected - echo '--- gamma/delta' >> $testroot/stdout.expected - echo '+++ gamma/delta' >> $testroot/stdout.expected + printf '--- gamma/delta\t\n' >> $testroot/stdout.expected + printf '+++ gamma/delta\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-delta' >> $testroot/stdout.expected echo '+modified delta' >> $testroot/stdout.expected @@ -604,8 +604,8 @@ test_commit_path_prefix() { | cut -d' ' -f 1 | sed -e 's/$/ (mode 644)/' \ >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- gamma/delta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- gamma/delta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-modified delta' >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected @@ -613,8 +613,8 @@ test_commit_path_prefix() { got tree -r $testroot/repo -c $commit3 -i gamma | grep 'new$' | \ cut -d' ' -f 1 | sed -e 's/$/ (mode 644)/' \ >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ gamma/new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ gamma/new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new' >> $testroot/stdout.expected blob - 09831aa5aa9e78af4b633c17418c853cdf8d7464779b6aa36870149d9fdbae56 blob + efc06753c6c5d9067c78428135c86374075552339d21fc1611f5b1648c3cb1f8 --- regress/cmdline/common.sh +++ regress/cmdline/common.sh @@ -305,6 +305,7 @@ test_done() if [ -z "$GOT_TEST_QUIET" ]; then echo "ok" fi + return 0 elif echo "$result" | grep -q "^xfail"; then # expected test failure; test reproduces an unfixed bug echo "$result" @@ -312,6 +313,7 @@ test_done() else echo "test failed; leaving test data in $testroot" fi + exit 1 } test_memleak_done() blob - 709d7c8966baa758a965027f35563d9344ba9396924601e0697ff3bff015eff5 blob + b48a8479fd68912fb78dd752ab03801692dd415d4b6a79b8093e8b3e6f651a95 --- regress/cmdline/diff.sh +++ regress/cmdline/diff.sh @@ -40,8 +40,8 @@ test_diff_basic() { got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + alpha' >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected @@ -50,15 +50,15 @@ test_diff_basic() { got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + new (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -127,8 +127,8 @@ test_diff_basic() { got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + alpha' >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected @@ -137,8 +137,8 @@ test_diff_basic() { got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo "commit - $head_rev" >> $testroot/stdout.expected @@ -146,16 +146,16 @@ test_diff_basic() { got tree -r $testroot/repo -i epsilon | grep 'zeta$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + epsilon/zeta' >> $testroot/stdout.expected - echo '--- epsilon/zeta' >> $testroot/stdout.expected - echo '+++ epsilon/zeta' >> $testroot/stdout.expected + printf '--- epsilon/zeta\t\n' >> $testroot/stdout.expected + printf '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-zeta' >> $testroot/stdout.expected echo '+modified zeta' >> $testroot/stdout.expected echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + new (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -275,15 +275,15 @@ test_diff_basic() { echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + master (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ master' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ master\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+master' >> $testroot/stdout.expected echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + new (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected cmp -s $testroot/stdout.expected $testroot/stdout @@ -318,8 +318,8 @@ test_diff_basic() { echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + new (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected (cd $testroot/wt && got diff new > $testroot/stdout) @@ -372,8 +372,8 @@ test_diff_basic() { echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + new (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected cmp -s $testroot/stdout.expected $testroot/stdout @@ -408,8 +408,8 @@ test_diff_basic() { cat <$testroot/diff.expected blob - $alpha_blobid blob + $alpha_new_blobid ---- $alpha_blobid -+++ $alpha_new_blobid +--- $alpha_blobid$(printf '\t') ++++ $alpha_new_blobid$(printf '\t') @@ -1 +1 @@ -alpha +modified alpha @@ -427,6 +427,80 @@ EOF test_done "$testroot" "$ret" } +test_diff_filename_with_whitespaces() { + local testroot=`test_init diff_filename_with_whitespaces` + local head_rev=`git_show_head $testroot/repo` + + got checkout $testroot/repo $testroot/wt > /dev/null + ret=$? + if [ $ret -ne 0 ]; then + test_done "$testroot" "$ret" + return 1 + fi + + # add a file with whitespaces in its name + (cd "$testroot/wt" && echo iota > 'iota file' && \ + got add 'iota file') >/dev/null + ret=$? + if [ $ret -ne 0 ]; then + echo "failed to add iota file" >&2 + test_done "$testroot" "$ret" + return 1 + fi + + cat < $testroot/stdout.expected +diff $testroot/wt +path + $testroot/wt +commit - $head_rev +blob - /dev/null +file + iota file (mode 644) +--- /dev/null$(printf '\t') ++++ iota file$(printf '\t') +@@ -0,0 +1 @@ ++iota +EOF + + (cd $testroot/wt && got diff > $testroot/stdout) + cmp -s $testroot/stdout.expected $testroot/stdout + ret=$? + if [ $ret -ne 0 ]; then + diff -u $testroot/stdout.expected $testroot/stdout + test_done "$testroot" "$ret" + return 1 + fi + + (cd $testroot/wt && got ci -m 'checkpoint') >/dev/null + + head_rev=`git_show_head $testroot/repo` + local iota_blobid=`get_blob_id $testroot/repo "" "iota file"` + + (cd $testroot/wt && echo 'new iota' > 'iota file') + + cat < $testroot/stdout.expected +diff $testroot/wt +path + $testroot/wt +commit - $head_rev +blob - $iota_blobid +file + iota file +--- iota file$(printf '\t') ++++ iota file$(printf '\t') +@@ -1 +1 @@ +-iota ++new iota +EOF + + (cd $testroot/wt && got diff > $testroot/stdout) + cmp -s $testroot/stdout.expected $testroot/stdout + ret=$? + if [ $ret -ne 0 ]; then + diff -u $testroot/stdout.expected $testroot/stdout + test_done "$testroot" "$ret" + return 1 + fi + + test_done "$testroot" 0 +} + test_diff_shows_conflict() { local testroot=`test_init diff_shows_conflict 1` @@ -487,8 +561,8 @@ test_diff_shows_conflict() { got tree -r $testroot/repo -i | grep 'numbers$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + numbers' >> $testroot/stdout.expected - echo '--- numbers' >> $testroot/stdout.expected - echo '+++ numbers' >> $testroot/stdout.expected + printf '--- numbers\t\n' >> $testroot/stdout.expected + printf '+++ numbers\t\n' >> $testroot/stdout.expected echo '@@ -1,8 +1,20 @@' >> $testroot/stdout.expected echo ' 1' >> $testroot/stdout.expected echo "+<<<<<<< merged change: commit $head_rev" \ @@ -553,8 +627,8 @@ test_diff_tag() { echo -n 'blob + ' >> $testroot/stdout.expected got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected @@ -576,8 +650,8 @@ test_diff_tag() { got tree -r $testroot/repo -i -c $commit_id2 | grep 'new$' | \ cut -d' ' -f 1 | tr -d '\n' >> $testroot/stdout.expected echo " (mode 644)" >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -618,8 +692,8 @@ test_diff_lightweight_tag() { echo -n 'blob + ' >> $testroot/stdout.expected got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected @@ -641,8 +715,8 @@ test_diff_lightweight_tag() { got tree -r $testroot/repo -i -c $commit_id2 | grep 'new$' | \ cut -d' ' -f 1 | tr -d '\n' >> $testroot/stdout.expected echo " (mode 644)" >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -757,8 +831,8 @@ test_diff_symlinks_in_work_tree() { grep 'alpha.link@ -> alpha$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected echo 'file + alpha.link' >> $testroot/stdout.expected - echo '--- alpha.link' >> $testroot/stdout.expected - echo '+++ alpha.link' >> $testroot/stdout.expected + printf '--- alpha.link\t\n' >> $testroot/stdout.expected + printf '+++ alpha.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -770,8 +844,8 @@ test_diff_symlinks_in_work_tree() { grep 'dotgotfoo.link@ -> .got/foo$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected echo 'file + dotgotfoo.link' >> $testroot/stdout.expected - echo '--- dotgotfoo.link' >> $testroot/stdout.expected - echo '+++ dotgotfoo.link' >> $testroot/stdout.expected + printf '--- dotgotfoo.link\t\n' >> $testroot/stdout.expected + printf '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-.got/foo' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -783,8 +857,8 @@ test_diff_symlinks_in_work_tree() { grep 'beta.link@ -> ../beta$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected echo 'file + epsilon/beta.link' >> $testroot/stdout.expected - echo '--- epsilon/beta.link' >> $testroot/stdout.expected - echo '+++ epsilon/beta.link' >> $testroot/stdout.expected + printf '--- epsilon/beta.link\t\n' >> $testroot/stdout.expected + printf '+++ epsilon/beta.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-../beta' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -796,8 +870,8 @@ test_diff_symlinks_in_work_tree() { grep 'epsilon.link@ -> epsilon$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected echo 'file + epsilon.link' >> $testroot/stdout.expected - echo '--- epsilon.link' >> $testroot/stdout.expected - echo '+++ epsilon.link' >> $testroot/stdout.expected + printf '--- epsilon.link\t\n' >> $testroot/stdout.expected + printf '+++ epsilon.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-epsilon' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -809,16 +883,16 @@ test_diff_symlinks_in_work_tree() { grep 'nonexistent.link@ -> nonexistent$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected echo 'file + /dev/null' >> $testroot/stdout.expected - echo '--- nonexistent.link' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- nonexistent.link\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-nonexistent' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected echo "commit - $commit_id1" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + zeta.link (mode 120000)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ zeta.link' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ zeta.link\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+epsilon/zeta' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -867,8 +941,8 @@ test_diff_symlinks_in_repo() { got tree -r $testroot/repo -c $commit_id2 -i | \ grep 'alpha.link@ -> beta$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected - echo '--- alpha.link' >> $testroot/stdout.expected - echo '+++ alpha.link' >> $testroot/stdout.expected + printf '--- alpha.link\t\n' >> $testroot/stdout.expected + printf '+++ alpha.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -882,8 +956,8 @@ test_diff_symlinks_in_repo() { got tree -r $testroot/repo -c $commit_id2 -i | \ grep 'dotgotfoo.link@ -> .got/bar$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected - echo '--- dotgotfoo.link' >> $testroot/stdout.expected - echo '+++ dotgotfoo.link' >> $testroot/stdout.expected + printf '--- dotgotfoo.link\t\n' >> $testroot/stdout.expected + printf '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-.got/foo' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -897,8 +971,8 @@ test_diff_symlinks_in_repo() { got tree -r $testroot/repo -c $commit_id2 -i epsilon | \ grep 'beta.link@ -> ../gamma/delta$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected - echo '--- epsilon/beta.link' >> $testroot/stdout.expected - echo '+++ epsilon/beta.link' >> $testroot/stdout.expected + printf '--- epsilon/beta.link\t\n' >> $testroot/stdout.expected + printf '+++ epsilon/beta.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-../beta' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -912,8 +986,8 @@ test_diff_symlinks_in_repo() { got tree -r $testroot/repo -c $commit_id2 -i | \ grep 'epsilon.link@ -> gamma$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected - echo '--- epsilon.link' >> $testroot/stdout.expected - echo '+++ epsilon.link' >> $testroot/stdout.expected + printf '--- epsilon.link\t\n' >> $testroot/stdout.expected + printf '+++ epsilon.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-epsilon' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -925,8 +999,8 @@ test_diff_symlinks_in_repo() { cut -d' ' -f 1 | sed -e 's/$/ (mode 120000)/' \ >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- nonexistent.link' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- nonexistent.link\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-nonexistent' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -936,8 +1010,8 @@ test_diff_symlinks_in_repo() { grep 'zeta.link@ -> epsilon/zeta$' | \ cut -d' ' -f 1 | sed -e 's/$/ (mode 120000)/' \ >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ zeta.link' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ zeta.link\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+epsilon/zeta' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -986,8 +1060,8 @@ test_diff_binary_files() { echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + foo (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ foo' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ foo\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected printf '+\377\377\0\0\377\377\0\0\n' >> $testroot/stdout.expected printf '\\ No newline at end of file\n' >> $testroot/stdout.expected @@ -1013,8 +1087,8 @@ test_diff_binary_files() { got tree -r $testroot/repo -i | grep 'foo$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + foo' >> $testroot/stdout.expected - echo '--- foo' >> $testroot/stdout.expected - echo '+++ foo' >> $testroot/stdout.expected + printf '--- foo\t\n' >> $testroot/stdout.expected + printf '+++ foo\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected printf -- '-\377\377\0\0\377\377\0\0\n' >> $testroot/stdout.expected printf '\\ No newline at end of file\n' >> $testroot/stdout.expected @@ -1058,21 +1132,21 @@ test_diff_commits() { echo "commit + $commit_id1" >> $testroot/stdout.expected echo "blob - $alpha_id0" >> $testroot/stdout.expected echo "blob + $alpha_id1" >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -1102,21 +1176,21 @@ test_diff_commits() { echo "commit + $commit_id1" >> $testroot/stdout.expected echo "blob - $alpha_id0" >> $testroot/stdout.expected echo "blob + $alpha_id1" >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected (cd $testroot/wt && got diff -c $commit_id0 -c $commit_id1 \ @@ -1135,8 +1209,8 @@ test_diff_commits() { echo "commit + $commit_id1" >> $testroot/stdout.expected echo "blob - $alpha_id0" >> $testroot/stdout.expected echo "blob + $alpha_id1" >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected @@ -1165,14 +1239,14 @@ test_diff_commits() { echo "commit + $commit_id1" >> $testroot/stdout.expected echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected (cd $testroot/repo && got diff -c $commit_id0 -c $commit_id1 \ @@ -1330,8 +1404,8 @@ test_diff_crlf() { printf 'one\r\ntwain\r\nthree\r\n' > $testroot/wt/crlf (cd $testroot/wt && got diff | sed -n '/^---/,$l' > $testroot/stdout) cat <<\EOF > $testroot/stdout.expected ---- crlf$ -+++ crlf$ +--- crlf\t$ ++++ crlf\t$ @@ -1,3 +1,3 @@$ one\r$ -two\r$ @@ -1379,8 +1453,8 @@ path + $testroot/wt commit - $commit_id blob - /dev/null file + xfile (mode 755) ---- /dev/null -+++ xfile +--- /dev/null$(printf '\t') ++++ xfile$(printf '\t') @@ -0,0 +1 @@ +xfile EOF @@ -1432,21 +1506,21 @@ EOF echo "commit + $commit_id1" >> $testroot/stdout.expected echo "blob - $alpha_id0" >> $testroot/stdout.expected echo "blob + $alpha_id1" >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -1486,21 +1560,21 @@ EOF echo "commit + $commit_id1" >> $testroot/stdout.expected echo "blob - $alpha_id0" >> $testroot/stdout.expected echo "blob + $alpha_id1" >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected (cd $testroot/wt && got diff -d -c $commit_id0 -c $commit_id1 \ @@ -1527,8 +1601,8 @@ EOF echo "commit + $commit_id1" >> $testroot/stdout.expected echo "blob - $alpha_id0" >> $testroot/stdout.expected echo "blob + $alpha_id1" >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected @@ -1567,14 +1641,14 @@ EOF echo "commit + $commit_id1" >> $testroot/stdout.expected echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected (cd $testroot/repo && got diff -d -c $commit_id0 -c $commit_id1 \ @@ -1621,8 +1695,8 @@ EOF got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + alpha' >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected @@ -1631,15 +1705,15 @@ EOF got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + new (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -1673,8 +1747,8 @@ EOF got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + alpha' >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified alpha' >> $testroot/stdout.expected @@ -1683,8 +1757,8 @@ EOF got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo "commit - $head_rev" >> $testroot/stdout.expected @@ -1692,16 +1766,16 @@ EOF got tree -r $testroot/repo -i epsilon | grep 'zeta$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + epsilon/zeta' >> $testroot/stdout.expected - echo '--- epsilon/zeta' >> $testroot/stdout.expected - echo '+++ epsilon/zeta' >> $testroot/stdout.expected + printf '--- epsilon/zeta\t\n' >> $testroot/stdout.expected + printf '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-zeta' >> $testroot/stdout.expected echo '+modified zeta' >> $testroot/stdout.expected echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + new (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -1756,15 +1830,15 @@ EOF echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + master (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ master' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ master\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+master' >> $testroot/stdout.expected echo "commit - $head_rev" >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + new (mode 644)' >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ new' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ new\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected cmp -s $testroot/stdout.expected $testroot/stdout @@ -1797,8 +1871,8 @@ diffstat $alpha_blobid $alpha_new_blobid blob - $alpha_blobid blob + $alpha_new_blobid ---- $alpha_blobid -+++ $alpha_new_blobid +--- $alpha_blobid$(printf '\t') ++++ $alpha_new_blobid$(printf '\t') @@ -1 +1 @@ -alpha +modified alpha @@ -1891,41 +1965,41 @@ test_diff_long_path_diffstat() { commit + $(cd "$testroot/wt" && got br -l | fgrep '*' | cut -d' ' -f3) blob - $blobid_alpha blob + $(get_blob_id "$testroot/repo" "" alpha longpath) - --- alpha - +++ alpha + --- alpha$(printf '\t') + +++ alpha$(printf '\t') @@ -1 +1 @@ -alpha +xalpha blob - $blobid_beta blob + $(get_blob_id "$testroot/repo" "" beta longpath) - --- beta - +++ beta + --- beta$(printf '\t') + +++ beta$(printf '\t') @@ -1 +1 @@ -beta +xbeta blob - $blobid_zeta blob + $(get_blob_id "$testroot/repo" "epsilon" zeta longpath) - --- epsilon/zeta - +++ epsilon/zeta + --- epsilon/zeta$(printf '\t') + +++ epsilon/zeta$(printf '\t') @@ -1 +1 @@ -zeta +xzeta blob - /dev/null blob + $blobid_longerpath (mode 644) - --- /dev/null - +++ $longerpath + --- /dev/null$(printf '\t') + +++ $longerpath$(printf '\t') @@ -0,0 +1 @@ +longerpath blob - /dev/null blob + $blobid_longpath (mode 644) - --- /dev/null - +++ $longpath + --- /dev/null$(printf '\t') + +++ $longpath$(printf '\t') @@ -0,0 +1 @@ +longpath blob - $blobid_delta blob + $(get_blob_id "$testroot/repo" "gamma" delta longpath) - --- gamma/delta - +++ gamma/delta + --- gamma/delta$(printf '\t') + +++ gamma/delta$(printf '\t') @@ -1 +1 @@ -delta +xdelta @@ -1967,14 +2041,14 @@ commit - $commit_id0 commit + $commit_id1 blob - $alpha_blobid (mode 644) blob + /dev/null ---- alpha -+++ /dev/null +--- alpha$(printf '\t') ++++ /dev/null$(printf '\t') @@ -1 +0,0 @@ -alpha blob - /dev/null blob + $alpha_eta_blobid (mode 644) ---- /dev/null -+++ alpha/eta +--- /dev/null$(printf '\t') ++++ alpha/eta$(printf '\t') @@ -0,0 +1 @@ +eta EOF @@ -2050,14 +2124,14 @@ commit - $commit_id0 commit + $commit_id1 blob - $epsilon_zeta_blobid (mode 644) blob + /dev/null ---- epsilon/zeta -+++ /dev/null +--- epsilon/zeta$(printf '\t') ++++ /dev/null$(printf '\t') @@ -1 +0,0 @@ -zeta blob - /dev/null blob + $epsilon_blobid (mode 644) ---- /dev/null -+++ epsilon +--- /dev/null$(printf '\t') ++++ epsilon$(printf '\t') @@ -0,0 +1 @@ +epsilon EOF @@ -2128,8 +2202,8 @@ commit - /dev/null commit + $commit_id blob - /dev/null blob + $alpha_blobid (mode 644) ---- /dev/null -+++ alpha +--- /dev/null$(printf '\t') ++++ alpha$(printf '\t') @@ -0,0 +1 @@ +alpha EOF @@ -2215,8 +2289,8 @@ test_diff_commit_keywords() { echo "commit + $(pop_idx 8 $@)" >> $testroot/stdout.expected echo "blob - $(pop_idx 4 $beta_ids)" >> $testroot/stdout.expected echo "blob + $(pop_idx 5 $beta_ids)" >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ beta' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ beta\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-beta change 5' >> $testroot/stdout.expected echo '+beta change 7' >> $testroot/stdout.expected @@ -2251,8 +2325,8 @@ test_diff_commit_keywords() { echo "commit + $(pop_idx 2 $@)" >> $testroot/stdout.expected echo "blob - $(pop_idx 1 $beta_ids)" >> $testroot/stdout.expected echo "blob + $(pop_idx 2 $beta_ids)" >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ beta' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ beta\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo '+beta change 1' >> $testroot/stdout.expected @@ -2279,8 +2353,8 @@ test_diff_commit_keywords() { echo "commit + $(pop_idx 4 $@)" >> $testroot/stdout.expected echo "blob - $(pop_idx 2 $beta_ids)" >> $testroot/stdout.expected echo "blob + $(pop_idx 3 $beta_ids)" >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ beta' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ beta\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-beta change 1' >> $testroot/stdout.expected echo '+beta change 3' >> $testroot/stdout.expected @@ -2308,8 +2382,8 @@ test_diff_commit_keywords() { echo "commit + $(pop_idx 9 $@)" >> $testroot/stdout.expected echo "blob - $(pop_idx 4 $alpha_ids)" >> $testroot/stdout.expected echo "blob + $(pop_idx 5 $alpha_ids)" >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha change 6' >> $testroot/stdout.expected echo '+alpha change 8' >> $testroot/stdout.expected @@ -2336,15 +2410,15 @@ test_diff_commit_keywords() { echo "commit + $(pop_idx 9 $@)" >> $testroot/stdout.expected echo "blob - $(pop_idx 2 $alpha_ids)" >> $testroot/stdout.expected echo "blob + $(pop_idx 5 $alpha_ids)" >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha change 2' >> $testroot/stdout.expected echo '+alpha change 8' >> $testroot/stdout.expected echo "blob - $(pop_idx 2 $beta_ids)" >> $testroot/stdout.expected echo "blob + $(pop_idx 5 $beta_ids)" >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ beta' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ beta\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-beta change 1' >> $testroot/stdout.expected echo '+beta change 7' >> $testroot/stdout.expected @@ -2371,15 +2445,15 @@ test_diff_commit_keywords() { echo "commit + $(pop_idx 8 $@)" >> $testroot/stdout.expected echo "blob - $(pop_idx 3 $alpha_ids)" >> $testroot/stdout.expected echo "blob + $(pop_idx 4 $alpha_ids)" >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha change 4' >> $testroot/stdout.expected echo '+alpha change 6' >> $testroot/stdout.expected echo "blob - $(pop_idx 4 $beta_ids)" >> $testroot/stdout.expected echo "blob + $(pop_idx 5 $beta_ids)" >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ beta' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ beta\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-beta change 5' >> $testroot/stdout.expected echo '+beta change 7' >> $testroot/stdout.expected @@ -2448,24 +2522,24 @@ test_diff_mixed_worktree() { commit - $baseid_alpha blob - $blobid_alpha file + alpha - --- alpha - +++ alpha + --- alpha$(printf '\t') + +++ alpha$(printf '\t') @@ -1 +1 @@ -'alpha +alpha commit - $baseid_beta blob - $blobid_beta file + beta - --- beta - +++ beta + --- beta$(printf '\t') + +++ beta$(printf '\t') @@ -1 +1 @@ -beta +'beta commit - $baseid_new blob - /dev/null file + new (mode 644) - --- /dev/null - +++ new + --- /dev/null$(printf '\t') + +++ new$(printf '\t') @@ -0,0 +1 @@ +new EOF @@ -2490,16 +2564,16 @@ test_diff_mixed_worktree() { commit - $baseid_alpha blob - $blobid_alpha blob + $stageid_alpha - --- alpha - +++ alpha + --- alpha$(printf '\t') + +++ alpha$(printf '\t') @@ -1 +1 @@ -'alpha +alpha commit - $baseid_beta blob - $blobid_beta blob + $stageid_beta - --- beta - +++ beta + --- beta$(printf '\t') + +++ beta$(printf '\t') @@ -1 +1 @@ -beta +'beta @@ -2519,6 +2593,7 @@ test_diff_mixed_worktree() { test_parseargs "$@" run_test test_diff_basic +run_test test_diff_filename_with_whitespaces run_test test_diff_shows_conflict run_test test_diff_tag run_test test_diff_lightweight_tag blob - 6a2f098cffe5489de75407cb6c60870e22ce472bb753c9f0ff3a0b870c5a279c blob + ac783d4b0db097b7b8727a69d2219088fdeda8666d77e2465c330c929ca4fdd0 --- regress/cmdline/import.sh +++ regress/cmdline/import.sh @@ -71,26 +71,26 @@ test_import_basic() { echo "commit + $head_commit" >> $testroot/stdout.expected echo "blob - /dev/null" >> $testroot/stdout.expected echo "blob + $id_alpha (mode 644)" >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ alpha" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+alpha" >> $testroot/stdout.expected echo "blob - /dev/null" >> $testroot/stdout.expected echo "blob + $id_beta (mode 644)" >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ beta" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ beta\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+beta" >> $testroot/stdout.expected echo "blob - /dev/null" >> $testroot/stdout.expected echo "blob + $id_zeta (mode 644)" >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ epsilon/zeta" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+zeta" >> $testroot/stdout.expected echo "blob - /dev/null" >> $testroot/stdout.expected echo "blob + $id_delta (mode 644)" >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ gamma/delta" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ gamma/delta\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+delta" >> $testroot/stdout.expected echo "" >> $testroot/stdout.expected @@ -197,26 +197,26 @@ test_import_specified_head() { echo "commit + $head_commit" >> $testroot/stdout.expected echo "blob - /dev/null" >> $testroot/stdout.expected echo "blob + $id_alpha (mode 644)" >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ alpha" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+alpha" >> $testroot/stdout.expected echo "blob - /dev/null" >> $testroot/stdout.expected echo "blob + $id_beta (mode 644)" >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ beta" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ beta\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+beta" >> $testroot/stdout.expected echo "blob - /dev/null" >> $testroot/stdout.expected echo "blob + $id_zeta (mode 644)" >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ epsilon/zeta" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+zeta" >> $testroot/stdout.expected echo "blob - /dev/null" >> $testroot/stdout.expected echo "blob + $id_delta (mode 644)" >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ gamma/delta" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ gamma/delta\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+delta" >> $testroot/stdout.expected echo "" >> $testroot/stdout.expected blob - 57503f19810ce7cb99a8309193c412df11869f9bbe17e24fe730807fd1d40110 blob + ac3ef59b97e98923227c9d398e108e722e788cb6b038545bff41b61720fcd0c3 --- regress/cmdline/revert.sh +++ regress/cmdline/revert.sh @@ -574,8 +574,8 @@ EOF >> $testroot/stdout.expected echo 'file + numbers' >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected echo 'file + numbers' >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected echo 'file + numbers' >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected echo ' (staged)' >> $testroot/stdout.expected echo 'file + alpha' >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-modified file' >> $testroot/stdout.expected echo '+modified file again' >> $testroot/stdout.expected @@ -952,8 +952,8 @@ test_stage_diff() { >> $testroot/stdout.expected echo " (staged)" >> $testroot/stdout.expected echo 'file + foo' >> $testroot/stdout.expected - echo '--- foo' >> $testroot/stdout.expected - echo '+++ foo' >> $testroot/stdout.expected + printf '--- foo\t\n' >> $testroot/stdout.expected + printf '+++ foo\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-new file' >> $testroot/stdout.expected echo '+new file changed' >> $testroot/stdout.expected @@ -977,8 +977,8 @@ test_stage_diff() { echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l alpha) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified file' >> $testroot/stdout.expected @@ -987,8 +987,8 @@ test_stage_diff() { got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo "commit - $head_commit" >> $testroot/stdout.expected @@ -996,8 +996,8 @@ test_stage_diff() { echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l foo) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ foo' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ foo\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -1393,8 +1393,8 @@ test_stage_commit() { >> $testroot/stdout.expected echo -n 'blob + ' >> $testroot/stdout.expected cat $testroot/blob_id_alpha >> $testroot/stdout.expected - echo '--- alpha' >> $testroot/stdout.expected - echo '+++ alpha' >> $testroot/stdout.expected + printf '--- alpha\t\n' >> $testroot/stdout.expected + printf '+++ alpha\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '+modified file' >> $testroot/stdout.expected @@ -1404,16 +1404,16 @@ test_stage_commit() { >> $testroot/stdout.expected echo " (mode 644)" >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-beta' >> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo -n 'blob + ' >> $testroot/stdout.expected cat $testroot/blob_id_foo | tr -d '\n' >> $testroot/stdout.expected echo " (mode 644)" >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ foo' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ foo\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+new file' >> $testroot/stdout.expected @@ -1607,8 +1607,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo "--- numbers" >> $testroot/stdout.expected - echo "+++ numbers" >> $testroot/stdout.expected + printf '--- numbers\t\n' >> $testroot/stdout.expected + printf '+++ numbers\t\n' >> $testroot/stdout.expected echo "@@ -4,7 +4,7 @@" >> $testroot/stdout.expected echo " 4" >> $testroot/stdout.expected echo " 5" >> $testroot/stdout.expected @@ -1714,8 +1714,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo "--- numbers" >> $testroot/stdout.expected - echo "+++ numbers" >> $testroot/stdout.expected + printf '--- numbers\t\n' >> $testroot/stdout.expected + printf '+++ numbers\t\n' >> $testroot/stdout.expected echo "@@ -13,4 +13,4 @@" >> $testroot/stdout.expected echo " 13" >> $testroot/stdout.expected echo " 14" >> $testroot/stdout.expected @@ -1869,8 +1869,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo "--- numbers" >> $testroot/stdout.expected - echo "+++ numbers" >> $testroot/stdout.expected + printf '--- numbers\t\n' >> $testroot/stdout.expected + printf '+++ numbers\t\n' >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected echo " (staged)" >> $testroot/stdout.expected echo 'file + numbers' >> $testroot/stdout.expected - echo "--- numbers" >> $testroot/stdout.expected - echo "+++ numbers" >> $testroot/stdout.expected + printf '--- numbers\t\n' >> $testroot/stdout.expected + printf '+++ numbers\t\n' >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected (cd $testroot/wt && got stage -l epsilon/new) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ epsilon/new" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ epsilon/new\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+new" >> $testroot/stdout.expected cmp -s $testroot/stdout.expected $testroot/stdout @@ -2097,8 +2097,8 @@ test_stage_patch_removed() { (cd $testroot/wt && got stage -l beta) | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo "--- beta" >> $testroot/stdout.expected - echo "+++ /dev/null" >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo "@@ -1 +0,0 @@" >> $testroot/stdout.expected echo "-beta" >> $testroot/stdout.expected cmp -s $testroot/stdout.expected $testroot/stdout @@ -2322,8 +2322,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo "--- numbers" >> $testroot/stdout.expected - echo "+++ numbers" >> $testroot/stdout.expected + printf '--- numbers\t\n' >> $testroot/stdout.expected + printf '+++ numbers\t\n' >> $testroot/stdout.expected echo "@@ -1,5 +1,5 @@" >> $testroot/stdout.expected echo " 1" >> $testroot/stdout.expected echo "-2" >> $testroot/stdout.expected @@ -2518,8 +2518,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l alpha.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- alpha.link' >> $testroot/stdout.expected - echo '+++ alpha.link' >> $testroot/stdout.expected + printf '--- alpha.link\t\n' >> $testroot/stdout.expected + printf '+++ alpha.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -2530,8 +2530,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l dotgotbar.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ dotgotbar.link' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ dotgotbar.link\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+.got/bar' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -2540,8 +2540,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l dotgotfoo.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ dotgotfoo.link' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+this is regular file foo' >> $testroot/stdout.expected echo "commit - $head_commit" >> $testroot/stdout.expected @@ -2551,8 +2551,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l epsilon/beta.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- epsilon/beta.link' >> $testroot/stdout.expected - echo '+++ epsilon/beta.link' >> $testroot/stdout.expected + printf '--- epsilon/beta.link\t\n' >> $testroot/stdout.expected + printf '+++ epsilon/beta.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-../beta' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -2565,8 +2565,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l epsilon.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- epsilon.link' >> $testroot/stdout.expected - echo '+++ epsilon.link' >> $testroot/stdout.expected + printf '--- epsilon.link\t\n' >> $testroot/stdout.expected + printf '+++ epsilon.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-epsilon' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -2577,8 +2577,8 @@ EOF got tree -r $testroot/repo -i | grep 'nonexistent.link@ -> nonexistent$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- nonexistent.link' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- nonexistent.link\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-nonexistent' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -2587,8 +2587,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l zeta.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ zeta.link' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ zeta.link\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+gamma/delta' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -2849,8 +2849,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l alpha.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- alpha.link' >> $testroot/stdout.expected - echo '+++ alpha.link' >> $testroot/stdout.expected + printf '--- alpha.link\t\n' >> $testroot/stdout.expected + printf '+++ alpha.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-alpha' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -2861,8 +2861,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l dotgotfoo.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ dotgotfoo.link' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+this is regular file foo' >> $testroot/stdout.expected echo "commit - $head_commit" >> $testroot/stdout.expected @@ -2872,8 +2872,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l epsilon.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- epsilon.link' >> $testroot/stdout.expected - echo '+++ epsilon.link' >> $testroot/stdout.expected + printf '--- epsilon.link\t\n' >> $testroot/stdout.expected + printf '+++ epsilon.link\t\n' >> $testroot/stdout.expected echo '@@ -1 +1 @@' >> $testroot/stdout.expected echo '-epsilon' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -2884,8 +2884,8 @@ EOF got tree -r $testroot/repo -i | grep 'nonexistent.link@ -> nonexistent$' | \ cut -d' ' -f 1 >> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo '--- nonexistent.link' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- nonexistent.link\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-nonexistent' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected @@ -2894,8 +2894,8 @@ EOF echo -n 'blob + ' >> $testroot/stdout.expected (cd $testroot/wt && got stage -l zeta.link) | cut -d' ' -f 1 \ >> $testroot/stdout.expected - echo '--- /dev/null' >> $testroot/stdout.expected - echo '+++ zeta.link' >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ zeta.link\t\n' >> $testroot/stdout.expected echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected echo '+gamma/delta' >> $testroot/stdout.expected echo '\ No newline at end of file' >> $testroot/stdout.expected blob - 812bbd03ae053feac9971dba5aa1d9546602c53146b6cdf836b4aa5b857384c2 blob + 3b6d843606291eafbf5c5413e057d142978a135be1f1424f344a01f57d6cda7e --- regress/cmdline/unstage.sh +++ regress/cmdline/unstage.sh @@ -419,8 +419,8 @@ EOF (cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \ >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected echo "file + numbers" >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected echo "file + numbers" >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected echo 'file + numbers' >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected echo 'blob - /dev/null' >> $testroot/stdout.expected echo 'file + epsilon/new (mode 644)' >> $testroot/stdout.expected - echo "--- /dev/null" >> $testroot/stdout.expected - echo "+++ epsilon/new" >> $testroot/stdout.expected + printf '--- /dev/null\t\n' >> $testroot/stdout.expected + printf '+++ epsilon/new\t\n' >> $testroot/stdout.expected echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected echo "+new" >> $testroot/stdout.expected cmp -s $testroot/stdout.expected $testroot/stdout @@ -873,8 +873,8 @@ test_unstage_patch_removed() { got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + /dev/null' >> $testroot/stdout.expected - echo "--- beta" >> $testroot/stdout.expected - echo "+++ /dev/null" >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo "@@ -1 +0,0 @@" >> $testroot/stdout.expected echo "-beta" >> $testroot/stdout.expected cmp -s $testroot/stdout.expected $testroot/stdout @@ -979,8 +979,8 @@ EOF tr -d '\n' >> $testroot/stdout.expected echo " (staged)" >> $testroot/stdout.expected echo "file + numbers" >> $testroot/stdout.expected - echo "--- numbers" >> $testroot/stdout.expected - echo "+++ numbers" >> $testroot/stdout.expected + printf '--- numbers\t\n' >> $testroot/stdout.expected + printf '+++ numbers\t\n' >> $testroot/stdout.expected echo "@@ -1,5 +1,5 @@" >> $testroot/stdout.expected echo " 1" >> $testroot/stdout.expected echo "-2" >> $testroot/stdout.expected @@ -1008,8 +1008,8 @@ EOF (cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \ >> $testroot/stdout.expected cat >> $testroot/stdout.expected <> $testroot/stdout.expected echo 'blob + /dev/null' >> $testroot/stdout.expected - echo "--- zzz" >> $testroot/stdout.expected - echo "+++ /dev/null" >> $testroot/stdout.expected + printf '--- zzz\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo "@@ -1 +0,0 @@" >> $testroot/stdout.expected echo "-zzz" >> $testroot/stdout.expected cmp -s $testroot/stdout.expected $testroot/stdout blob - 88f867850a9affdd90d03ac9298b2bc870533de7cdd553988334d49545909665 blob + ad858adc1a58fb852908a501a86c6b24c8a513b9c02a77c86899e3c728b5a03f --- regress/cmdline/update.sh +++ regress/cmdline/update.sh @@ -1184,8 +1184,8 @@ test_update_conflict_wt_rm_vs_repo_edit() { got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \ >> $testroot/stdout.expected echo 'file + /dev/null' >> $testroot/stdout.expected - echo '--- beta' >> $testroot/stdout.expected - echo '+++ /dev/null' >> $testroot/stdout.expected + printf '--- beta\t\n' >> $testroot/stdout.expected + printf '+++ /dev/null\t\n' >> $testroot/stdout.expected echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected echo '-modified beta' >> $testroot/stdout.expected blob - e62077059b94d56194077deda2dd8ffc63037cbf153221c8e0b9e9cc1de70712 blob + 3dea32d6e0717db54dd83bd8e6298af35b00f622b6d567af84a904ef6fb2f51c --- regress/gotwebd/action_diff.html +++ regress/gotwebd/action_diff.html @@ -7,26 +7,26 @@ Content-Type: text/html commit + ${COMMIT_ID} blob - /dev/null blob + ${BLOB_ALPHA} (mode 644) ---- /dev/null -+++ alpha +--- /dev/null ++++ alpha @@ -0,0 +1 @@ +alpha blob - /dev/null blob + ${BLOB_BETA} (mode 644) ---- /dev/null -+++ beta +--- /dev/null ++++ beta @@ -0,0 +1 @@ +beta blob - /dev/null blob + ${BLOB_ZETA} (mode 644) ---- /dev/null -+++ epsilon/zeta +--- /dev/null ++++ epsilon/zeta @@ -0,0 +1 @@ +zeta blob - /dev/null blob + ${BLOB_DELTA} (mode 644) ---- /dev/null -+++ gamma/delta +--- /dev/null ++++ gamma/delta @@ -0,0 +1 @@ +delta blob - ec272fcaaa9b8d35750d0556ea313d771f232d635e212c2237aafadcbe28536e blob + 75767037b7e1be26357482c386dc06255fcd0eb908c12d2472a2f75ac6fe6ed2 --- regress/gotwebd/action_patch.html +++ regress/gotwebd/action_patch.html @@ -11,26 +11,26 @@ commit - /dev/null commit + ${COMMIT_ID} blob - /dev/null blob + ${BLOB_ALPHA} (mode 644) ---- /dev/null -+++ alpha +--- /dev/null ++++ alpha @@ -0,0 +1 @@ +alpha blob - /dev/null blob + ${BLOB_BETA} (mode 644) ---- /dev/null -+++ beta +--- /dev/null ++++ beta @@ -0,0 +1 @@ +beta blob - /dev/null blob + ${BLOB_ZETA} (mode 644) ---- /dev/null -+++ epsilon/zeta +--- /dev/null ++++ epsilon/zeta @@ -0,0 +1 @@ +zeta blob - /dev/null blob + ${BLOB_DELTA} (mode 644) ---- /dev/null -+++ gamma/delta +--- /dev/null ++++ gamma/delta @@ -0,0 +1 @@ +delta blob - 5324f75510d7ed8f0e22bc723047e8182a7ec738d74a59986e6c0f84e617da7e blob + ce927555879823b752e829d23f8ba8f884f228c8018ab88beaf9052f62bd3ae9 --- regress/tog/diff.sh +++ regress/tog/diff.sh @@ -593,8 +593,8 @@ commit - $id_mid commit + $id_head blob - $beta_mid blob + $beta_head ---- beta -+++ beta +--- beta$(printf '\t') ++++ beta$(printf '\t') @@ -1 +1 @@ -beta +modified beta @@ -636,15 +636,15 @@ commit - $id_root commit + $id_head blob - $alpha_root blob + $alpha_mid ---- alpha -+++ alpha +--- alpha$(printf '\t') ++++ alpha$(printf '\t') @@ -1 +1 @@ -alpha +modified alpha blob - $beta_root blob + $beta_head ---- beta -+++ beta +--- beta$(printf '\t') ++++ beta$(printf '\t') @@ -1 +1 @@ -beta +modified beta