commit - d0c4e49e831f98e5984cc1e96ce47b8ad9bc038f
commit + b24db1c106cc7d53cf2931a1d0898b95d1d058ed
blob - ac29d637e011820ba1305f8c0c5c84a2eb40dfc3
blob + c34f7676e910c0441ee471180dfdcd5af119d970
--- regress/cmdline/blame.sh
+++ regress/cmdline/blame.sh
. ./common.sh
+function blame_cmp {
+ local testroot="$1"
+ local file="$2"
+
+ (cd $testroot/wt && got blame "$file" | cut -d ' ' -f 2 \
+ > $testroot/${file}.blame.got)
+ (cd $testroot/repo && git reset --hard master > /dev/null)
+ (cd $testroot/repo && git blame "$file" | cut -d ' ' -f 1 \
+ > $testroot/${file}.blame.git)
+
+ cmp -s $testroot/${file}.blame.git $testroot/${file}.blame.got
+ ret="$?"
+ if [ "$ret" != "0" ]; then
+ diff -u $testroot/${file}.blame.git $testroot/${file}.blame.got
+ return 1
+ fi
+ return 0
+}
+
function test_blame_basic {
local testroot=`test_init blame_basic`
ret="$?"
if [ "$ret" != "0" ]; then
diff -u $testroot/stdout.expected $testroot/stdout
+ test_done "$testroot" "$ret"
+ return 1
fi
+ blame_cmp "$testroot" "alpha"
+ ret="$?"
test_done "$testroot" "$ret"
}
ret="$?"
if [ "$ret" != "0" ]; then
diff -u $testroot/stdout.expected $testroot/stdout
+ test_done "$testroot" "$ret"
+ return 1
fi
+
+ blame_cmp "$testroot" "alpha"
+ ret="$?"
test_done "$testroot" "$ret"
}
ret="$?"
if [ "$ret" != "0" ]; then
diff -u $testroot/stdout.expected $testroot/stdout
+ test_done "$testroot" "$ret"
+ return 1
fi
+
+ blame_cmp "$testroot" "alpha"
+ ret="$?"
test_done "$testroot" "$ret"
}
ret="$?"
if [ "$ret" != "0" ]; then
diff -u $testroot/stdout.expected $testroot/stdout
+ test_done "$testroot" "$ret"
+ return 1
fi
+ blame_cmp "$testroot" "alpha"
+ ret="$?"
test_done "$testroot" "$ret"
}
ret="$?"
if [ "$ret" != "0" ]; then
diff -u $testroot/stdout.expected $testroot/stdout
+ test_done "$testroot" "$ret"
+ return 1
fi
+ blame_cmp "$testroot" "alpha"
+ ret="$?"
test_done "$testroot" "$ret"
}
test_done "$testroot" "$ret"
return 1
fi
+
+ blame_cmp "$testroot" "alpha"
+ ret="$?"
test_done "$testroot" "$ret"
}