fixed return type, add tag source, fix root repo detection