{"thread":{"id":"1699","subject":"[PATCH] cg-update - refuse to update dirty tree","startedAt":"2005-08-30T09:37:28Z","lastAt":"2005-08-30T09:37:28Z","messageCount":1,"participants":["Martin Langhoff"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7947","messageId":"11253946482734-git-send-email-martin@catalyst.net.nz","threadId":"1699","inReplyTo":null,"subject":"[PATCH] cg-update - refuse to update dirty tree","fromName":"Martin Langhoff","fromEmail":"martin@catalyst.net.nz","sentAt":"2005-08-30T09:37:28Z","receivedAt":"2005-08-30T09:37:28Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"cg-merge currently clobbers local changes while runnign cg-update. Do the\nsafe thing and refuse to update on a dirty tree.\n\nSigned-off-by: Martin Langhoff <martin@catalyst.net.nz>\n\n\n---\n\n cg-update |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\n7a961c02ee6228c2a80869b4b3f179a7e279df8e\ndiff --git a/cg-update b/cg-update\n--- a/cg-update\n+++ b/cg-update\n@@ -27,6 +27,10 @@ while optparse; do\n \tfi\n done\n \n+# Better safe than sorry\n+(git-update-cache --refresh >> /dev/null) ||\n+        die \"Your working tree is dirty - will not update.\"\n+\n name=${ARGS[0]}\n [ \"$name\" ] || { [ -s $_git/refs/heads/origin ] && name=origin; }\n [ \"$name\" ] || die \"where to update from?\"\n"}]}