Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.599
diff -u -p -r1.599 taxonomy.module
--- modules/taxonomy/taxonomy.module	25 Jul 2010 02:45:27 -0000	1.599
+++ modules/taxonomy/taxonomy.module	30 Jul 2010 04:57:09 -0000
@@ -461,7 +461,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.83
diff -u -p -r1.83 taxonomy.test
--- modules/taxonomy/taxonomy.test	30 Jul 2010 03:06:18 -0000	1.83
+++ modules/taxonomy/taxonomy.test	30 Jul 2010 04:57:09 -0000
@@ -397,6 +397,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);
