summaryrefslogtreecommitdiff
path: root/rvs/plugins/tree/bin/addparent.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rvs/plugins/tree/bin/addparent.sh')
-rw-r--r--rvs/plugins/tree/bin/addparent.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/rvs/plugins/tree/bin/addparent.sh b/rvs/plugins/tree/bin/addparent.sh
index af60e5a..6759bcb 100644
--- a/rvs/plugins/tree/bin/addparent.sh
+++ b/rvs/plugins/tree/bin/addparent.sh
@@ -21,12 +21,15 @@ usage="usage: $RVS $name CHILD PARENT"
child=${1?"$usage"}
parent=${2?"$usage"}
-ct="`"$RVS" blob-gettype "$child"`"
-pt="`"$RVS" blob-gettype "$parent"`"
-
-if [ "$ct" = "$pt" ]; then
- "$RVS" "addparent.$ct" "$child" "$parent"
-else
- error "CHILD and PARENT must be type of the same type"
+if [ ! "$child" = "$parent" ]; then
+ ct="`"$RVS" blob-gettype "$child"`"
+ pt="`"$RVS" blob-gettype "$parent"`"
+
+ if [ "$ct" = "$pt" ]; then
+ "$RVS" "addparent.$ct" "$child" "$parent"
+ else
+ echo "$0: CHILD and PARENT must be the same type">>/dev/stderr
+ exit 1
+ fi
fi