]> scripts.mit.edu Git - wizard.git/commitdiff
Make gct support multiple filenames.
authorEdward Z. Yang <ezyang@mit.edu>
Sun, 14 Nov 2010 16:31:54 +0000 (16:31 +0000)
committerEdward Z. Yang <ezyang@mit.edu>
Sun, 14 Nov 2010 16:31:54 +0000 (16:31 +0000)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
TODO
bin/gct

diff --git a/TODO b/TODO
index 7fc3e933f9df5df3c873ef3e118eab9c51eef3d9..a8da5bfddc5a9615738d82c4c4d711d594fcb5fa 100644 (file)
--- a/TODO
+++ b/TODO
@@ -23,7 +23,6 @@
   detect this URL as baked in from the configuration
 
 - Rerere support doesn't actually work
-- Utility scripts gct should support multiple filenames
 - "Version 3.0.0 doesn't exist; did you mean 3.0?"
 - util.fetch() should use urllib under the hood, not httplib.  Code
   has to be changed.  We should log if we get redirected.
diff --git a/bin/gct b/bin/gct
index e3da5a8645529781967bb4f3792555bf02c1c086..ad3ee81c8680dfedd071aaf565a6716358767cb5 100755 (executable)
--- a/bin/gct
+++ b/bin/gct
@@ -5,8 +5,11 @@ then
     echo "Usage: gct FILE"
     exit 1
 fi
-OWNER=$(stat -c "%u:%g" "$1")
 set -x
-git checkout --theirs "$1"
-chown "$OWNER" "$1"
-git add "$1"
+for file in "$@"
+do
+    OWNER=$(stat -c "%u:%g" "$file")
+    git checkout --theirs "$file"
+    chown "$OWNER" "$file"
+    git add "$file"
+done