commit 14e5d4dcac6e70e8ce1dc7434f4e4f5aa6dbf963 from: Stefan Sperling date: Tue Feb 05 21:25:42 2019 UTC fix bug with wrong size comparison in get_file_status() commit - 6efaaa2dc11f89afcaa5a87df73fbcb123c66729 commit + 14e5d4dcac6e70e8ce1dc7434f4e4f5aa6dbf963 blob - 6a1ed9214ccefdc0e2e7887070242ef8d0cde738 blob + 708cf625a91485cd69e6b44a4ed2699c28850ec7 --- lib/worktree.c +++ lib/worktree.c @@ -999,7 +999,7 @@ get_file_status(unsigned char *status, struct got_file if (blen != 0) *status = GOT_STATUS_MODIFIY; break; - } else if (blen == flen) { + } else if (blen - hdrlen == flen) { /* Skip blob object header first time around. */ if (memcmp(bbuf + hdrlen, fbuf, flen) != 0) { *status = GOT_STATUS_MODIFIY; blob - d6d36bcc7878ddddaba818d1e6e754ba3c3f787d blob + c74933deea94f58a5325f8288e175d73fa64ee10 --- regress/cmdline/status.sh +++ regress/cmdline/status.sh @@ -28,6 +28,7 @@ function test_status_basic { echo "modified alpha" > $testroot/wt/alpha echo "unversioned file" > $testroot/wt/foo rm $testroot/wt/epsilon/zeta + touch $testroot/wt/beta echo 'M alpha' > $testroot/stdout.expected echo '! epsilon/zeta' >> $testroot/stdout.expected