show path in error message when blaming a symlink pointing to a directory
diff --git a/got/got.c b/got/got.c
index ab4db7c..d2353a4 100644
--- a/got/got.c
+++ b/got/got.c
@@ -4230,7 +4230,8 @@ cmd_blame(int argc, char *argv[])
goto done;
if (obj_type != GOT_OBJ_TYPE_BLOB) {
- error = got_error(GOT_ERR_OBJ_TYPE);
+ error = got_error_path(link_target ? link_target : in_repo_path,
+ GOT_ERR_OBJ_TYPE);
goto done;
}
diff --git a/regress/cmdline/blame.sh b/regress/cmdline/blame.sh
index d3a3bf3..171849c 100755
--- a/regress/cmdline/blame.sh
+++ b/regress/cmdline/blame.sh
@@ -831,7 +831,7 @@ function test_blame_symlink {
fi
# blame dereferences symlink to a directory
- echo "got: wrong type of object" > $testroot/stderr.expected
+ echo "got: /epsilon: wrong type of object" > $testroot/stderr.expected
cmp -s $testroot/stderr.expected $testroot/stderr
ret="$?"
if [ "$ret" != "0" ]; then