Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.583
diff -u -p -r1.583 taxonomy.module
--- modules/taxonomy/taxonomy.module	28 Mar 2010 11:39:35 -0000	1.583
+++ modules/taxonomy/taxonomy.module	5 Apr 2010 21:08:12 -0000
@@ -440,7 +440,7 @@ function taxonomy_check_vocabulary_hiera
       $hierarchy = 2;
       break;
     }
-    elseif (count($term->parents) == 1 && 0 !== array_shift($term->parents)) {
+    elseif (count($term->parents) == 1 && !isset($term->parents[0])) {
       $hierarchy = 1;
     }
   }
Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.75
diff -u -p -r1.75 taxonomy.test
--- modules/taxonomy/taxonomy.test	27 Mar 2010 05:52:50 -0000	1.75
+++ modules/taxonomy/taxonomy.test	5 Apr 2010 21:08:12 -0000
@@ -363,6 +363,10 @@ class TaxonomyTermTestCase extends Taxon
     $term1 = $this->createTerm($this->vocabulary);
     $term2 = $this->createTerm($this->vocabulary);
 
+    // Check that hierarchy is flat.
+    $vocabulary = taxonomy_vocabulary_load($this->vocabulary->vid);
+    $this->assertEqual(0, $vocabulary->hierarchy, t('Vocabulary is flat.'));
+
     // Edit $term2, setting $term1 as parent.
     $edit = array();
     $edit['parent[]'] = array($term1->tid);
