commit - a0c556f159f44e9a0b012bc912aa5c47f405510a5a2528f57dcad9d8b9dcc9ae
commit + eff4b972377331c3faf693c81c0b90e0aa8fe60664709c4e3697d427e51a0232
blob - fdfb062cfddc34893c731ea1265005e08393962bf15d34e260dd5f55be7d3c49
blob + 6d61d3e7ec3b91febea0a7ff206277c57bf4f8d00ac4e717a695e937700a995e
--- lib/diff_output_unidiff.c
+++ lib/diff_output_unidiff.c
}
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;
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
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.
*/
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
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.
*
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
fi
cat > $testroot/diff.expected <<EOF
---- reference.c
-+++ reference.c
+--- reference.c$(printf '\t')
++++ reference.c$(printf '\t')
@@ -250,6 +250,7 @@ got_ref_list_free(struct got_reflist_head *refs)
while ((re = TAILQ_FIRST(refs))) {
blob - f05b420cac9d5f5f83eae70b5bc3376b14e6a34a75e14ec596ee6712e0b7cf97
blob + 27cd1ade413da1d898e58df163433229c2b96525ea106bd074dd8d1194a1d845
--- regress/cmdline/commit.sh
+++ regress/cmdline/commit.sh
commit + $conflict_commit
blob - $blob_minus
blob + $blob_plus
---- alpha
-+++ alpha
+--- alpha$(printf '\t')
++++ alpha$(printf '\t')
@@ -1 +1,7 @@
+<<<<<<< merged change: commit $commit_id1
modified alpha
echo -n 'blob + ' >> $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
| 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
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
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"
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
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
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
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
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
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
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
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)
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
cat <<EOF >$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
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 <<EOF > $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 <<EOF > $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`
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" \
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 \
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 "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 \
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$
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
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
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 \
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 "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 \
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
>> $testroot/stdout.expected
echo 'file + numbers' >> $testroot/stdout.expected
cat >> $testroot/stdout.expected <<EOF
---- numbers
-+++ numbers
+--- numbers$(printf '\t')
++++ numbers$(printf '\t')
@@ -4,7 +4,7 @@
4
5
>> $testroot/stdout.expected
echo 'file + numbers' >> $testroot/stdout.expected
cat >> $testroot/stdout.expected <<EOF
---- numbers
-+++ numbers
+--- numbers$(printf '\t')
++++ numbers$(printf '\t')
@@ -1,5 +1,5 @@
1
-2
>> $testroot/stdout.expected
echo 'file + numbers' >> $testroot/stdout.expected
cat >> $testroot/stdout.expected <<EOF
---- numbers
-+++ numbers
+--- numbers$(printf '\t')
++++ numbers$(printf '\t')
@@ -1,5 +1,5 @@
1
-2
commit - $commit_id
blob - $blobid_zeta
blob + $stageid_zeta
- --- epsilon/zeta
- +++ epsilon/zeta
+ --- epsilon/zeta$(printf '\t')
+ +++ epsilon/zeta$(printf '\t')
@@ -1,10 +1,10 @@
-line 0
+line 0a
commit - $commit_id
blob - $blobid_zeta
blob + $stageid_zeta
- --- epsilon/zeta
- +++ epsilon/zeta
+ --- epsilon/zeta$(printf '\t')
+ +++ epsilon/zeta$(printf '\t')
@@ -1,4 +1,4 @@
-line 0
+line 0a
blob - 5a051c2456712647af13bb1aa6ee683815a967bd403442575f395340ade7e321
blob + ac9d47eb756f7a68a630f6b787617d6fb923ce43c0ceecad7f3ef4e4583b4edd
--- regress/cmdline/stage.sh
+++ regress/cmdline/stage.sh
>> $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
>> $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
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
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
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
>> $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
>> $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
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
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
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 <<EOF
@@ -4,7 +4,7 @@
4
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
cat >> $testroot/stdout.expected <<EOF
@@ -1,5 +1,5 @@
1
echo -n 'blob + ' >> $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
(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
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
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
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
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
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
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
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
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
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
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
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
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
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
(cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \
>> $testroot/stdout.expected
cat >> $testroot/stdout.expected <<EOF
---- numbers
-+++ numbers
+--- numbers$(printf '\t')
++++ numbers$(printf '\t')
@@ -1,5 +1,5 @@
1
-2
echo " (staged)" >> $testroot/stdout.expected
echo "file + numbers" >> $testroot/stdout.expected
cat >> $testroot/stdout.expected <<EOF
---- numbers
-+++ numbers
+--- numbers$(printf '\t')
++++ numbers$(printf '\t')
@@ -4,7 +4,7 @@ a
4
5
(cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \
>> $testroot/stdout.expected
cat >> $testroot/stdout.expected <<EOF
---- numbers
-+++ numbers
+--- numbers$(printf '\t')
++++ numbers$(printf '\t')
@@ -1,10 +1,10 @@
1
-2
echo " (staged)" >> $testroot/stdout.expected
echo "file + numbers" >> $testroot/stdout.expected
cat >> $testroot/stdout.expected <<EOF
---- numbers
-+++ numbers
+--- numbers$(printf '\t')
++++ numbers$(printf '\t')
@@ -13,4 +13,4 @@ b
13
14
>> $testroot/stdout.expected
echo 'file + numbers' >> $testroot/stdout.expected
cat >> $testroot/stdout.expected <<EOF
---- numbers
-+++ numbers
+--- numbers$(printf '\t')
++++ numbers$(printf '\t')
@@ -1,10 +1,10 @@
1
-2
echo "commit - $commit_id" >> $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
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
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
(cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \
>> $testroot/stdout.expected
cat >> $testroot/stdout.expected <<EOF
---- numbers
-+++ numbers
+--- numbers$(printf '\t')
++++ numbers$(printf '\t')
@@ -4,7 +4,7 @@
4
5
got tree -r $testroot/repo -i | grep 'zzz$' | cut -d' ' -f 1 \
>> $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
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
<span class="diff_line diff_meta">commit + ${COMMIT_ID}</span>
<span class="diff_line diff_meta">blob - /dev/null</span>
<span class="diff_line diff_meta">blob + ${BLOB_ALPHA} (mode 644)</span>
-<span class="diff_line diff_minus">--- /dev/null</span>
-<span class="diff_line diff_plus">+++ alpha</span>
+<span class="diff_line diff_minus">--- /dev/null </span>
+<span class="diff_line diff_plus">+++ alpha </span>
<span class="diff_line diff_chunk_header">@@ -0,0 +1 @@</span>
<span class="diff_line diff_plus">+alpha</span>
<span class="diff_line diff_meta">blob - /dev/null</span>
<span class="diff_line diff_meta">blob + ${BLOB_BETA} (mode 644)</span>
-<span class="diff_line diff_minus">--- /dev/null</span>
-<span class="diff_line diff_plus">+++ beta</span>
+<span class="diff_line diff_minus">--- /dev/null </span>
+<span class="diff_line diff_plus">+++ beta </span>
<span class="diff_line diff_chunk_header">@@ -0,0 +1 @@</span>
<span class="diff_line diff_plus">+beta</span>
<span class="diff_line diff_meta">blob - /dev/null</span>
<span class="diff_line diff_meta">blob + ${BLOB_ZETA} (mode 644)</span>
-<span class="diff_line diff_minus">--- /dev/null</span>
-<span class="diff_line diff_plus">+++ epsilon/zeta</span>
+<span class="diff_line diff_minus">--- /dev/null </span>
+<span class="diff_line diff_plus">+++ epsilon/zeta </span>
<span class="diff_line diff_chunk_header">@@ -0,0 +1 @@</span>
<span class="diff_line diff_plus">+zeta</span>
<span class="diff_line diff_meta">blob - /dev/null</span>
<span class="diff_line diff_meta">blob + ${BLOB_DELTA} (mode 644)</span>
-<span class="diff_line diff_minus">--- /dev/null</span>
-<span class="diff_line diff_plus">+++ gamma/delta</span>
+<span class="diff_line diff_minus">--- /dev/null </span>
+<span class="diff_line diff_plus">+++ gamma/delta </span>
<span class="diff_line diff_chunk_header">@@ -0,0 +1 @@</span>
<span class="diff_line diff_plus">+delta</span>
</pre></div></main><footer id="site_owner_wrapper"><p id="site_owner">Got Owner</p></footer></body></html>
blob - ec272fcaaa9b8d35750d0556ea313d771f232d635e212c2237aafadcbe28536e
blob + 75767037b7e1be26357482c386dc06255fcd0eb908c12d2472a2f75ac6fe6ed2
--- regress/gotwebd/action_patch.html
+++ regress/gotwebd/action_patch.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 - 5324f75510d7ed8f0e22bc723047e8182a7ec738d74a59986e6c0f84e617da7e
blob + ce927555879823b752e829d23f8ba8f884f228c8018ab88beaf9052f62bd3ae9
--- regress/tog/diff.sh
+++ regress/tog/diff.sh
commit + $id_head
blob - $beta_mid
blob + $beta_head
---- beta
-+++ beta
+--- beta$(printf '\t')
++++ beta$(printf '\t')
@@ -1 +1 @@
-beta
+modified beta
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