diff --git a/vendorsetup.sh b/vendorsetup.sh
index 935b818d68a8338c203f0cff8ae6b6cf416bf86c..a7cadb432bd0c5cceffa5fdfb273051a4795599b 100644
--- a/vendorsetup.sh
+++ b/vendorsetup.sh
@@ -1,4 +1,4 @@
-# Copyright (c) 2012, The Linux Foundation. All rights reserved.
+# Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -54,10 +54,10 @@ __tree_md5sum()
 
 __abandon_tree()
 {
-   rm -f out/lastpatch.md5sum
    if [[ -d .repo ]]; then
       ${REPO} abandon b2g_autogen_ephemeral_branch || true
    fi
+   rm -f .lastpatch.md5sum
 }
 
 
@@ -72,14 +72,16 @@ __patch_tree()
       echo -n ">> Analyzing workspace for change..."
       local LASTMD5SUM=invalid
       local MD5SUM=unknown
-      if [[ -f out/lastpatch.md5sum ]]; then
-         LASTMD5SUM=$(cat out/lastpatch.md5sum)
+      if [[ -f .lastpatch.md5sum ]]; then
+         LASTMD5SUM=$(cat .lastpatch.md5sum)
          MD5SUM=$(__tree_md5sum ${B2G_PATCH_DIRS})
       fi
       if [[ "$LASTMD5SUM" != "$MD5SUM" ]]; then
-         echo "Change detected.  Applying B2G patches".
+         echo "Change detected.  Applying B2G patches."
 
-         __abandon_tree
+         if [[ -f .lastpatch.md5sum ]]; then
+            __abandon_tree
+         fi
 
          branch() {
             [[ -d $1 ]] || return 1
@@ -217,7 +219,7 @@ __patch_tree()
          echo
          echo B2G patches applied.
          mkdir -p out
-         echo $(__tree_md5sum ${B2G_PATCH_DIRS}) > out/lastpatch.md5sum
+         echo $(__tree_md5sum ${B2G_PATCH_DIRS}) > .lastpatch.md5sum
       else
          echo no changes detected.
       fi