summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-11-04 08:42:47 +0100
committerJens Axboe <jens.axboe@oracle.com>2008-11-04 08:42:47 +0100
commit9a6f9ab23712f79f9d21cb65f8865b6b0e152e49 (patch)
tree837b4ca9499d2fe44b5e26ed584e7e136728cfce
parentea98207a16b89808b96d7091e31d0df0146c9153 (diff)
downloadag-9a6f9ab23712f79f9d21cb65f8865b6b0e152e49.tar.gz
ag-9a6f9ab23712f79f9d21cb65f8865b6b0e152e49.tar.bz2
Update
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rwxr-xr-xag-diff-checkout17
1 files changed, 17 insertions, 0 deletions
diff --git a/ag-diff-checkout b/ag-diff-checkout
new file mode 100755
index 0000000..42b7aba
--- /dev/null
+++ b/ag-diff-checkout
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+. ag-common
+
+check_git_dir
+
+if [ -z "$1" ]; then
+ echo Need filename to save to
+ exit 1
+elif [ -f "$1" ]; then
+ echo "$1" already exists
+ exit 2
+fi
+
+git diff > $1
+git checkout-index -f $(mkcf $1)
+git update-index --refresh