[PATCH] cg-update - refuse to update dirty tree

From: Martin Langhoff <martin@catalyst.net.nz>
Date: 2005-08-30 19:37:28
cg-merge currently clobbers local changes while runnign cg-update. Do the
safe thing and refuse to update on a dirty tree.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>


---

 cg-update |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

7a961c02ee6228c2a80869b4b3f179a7e279df8e
diff --git a/cg-update b/cg-update
--- a/cg-update
+++ b/cg-update
@@ -27,6 +27,10 @@ while optparse; do
 	fi
 done
 
+# Better safe than sorry
+(git-update-cache --refresh >> /dev/null) ||
+        die "Your working tree is dirty - will not update."
+
 name=${ARGS[0]}
 [ "$name" ] || { [ -s $_git/refs/heads/origin ] && name=origin; }
 [ "$name" ] || die "where to update from?"

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue Aug 30 19:39:24 2005

This archive was generated by hypermail 2.1.8 : 2005-08-30 19:39:26 EST