Merge branch 'jc/lockfile' into next
authorJunio C Hamano <junkio@cox.net>
Tue, 6 Jun 2006 21:31:29 +0000 (14:31 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 6 Jun 2006 21:31:29 +0000 (14:31 -0700)
* jc/lockfile:
  ref-log: style fixes.
  refs.c: convert it to use lockfile interface.
  Make index file locking code reusable to others.
  HTTP cleanup
  HTTP cleanup
  git-format-patch: add --output-directory long option again

1  2 
builtin-read-tree.c
write-tree.c

@@@ -875,9 -851,9 +875,9 @@@ static void prime_cache_tree(void
  
  }
  
 -static const char read_tree_usage[] = "git-read-tree (<sha> | -m [--aggressive] [-u | -i] <sha1> [<sha2> [<sha3>]])";
 +static const char read_tree_usage[] = "git-read-tree (<sha> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] <sha1> [<sha2> [<sha3>]])";
  
- static struct cache_file cache_file;
+ static struct lock_file lock_file;
  
  int cmd_read_tree(int argc, const char **argv, char **envp)
  {
diff --cc write-tree.c
@@@ -8,12 -8,10 +8,12 @@@
  #include "cache-tree.h"
  
  static int missing_ok = 0;
 +static char *prefix = NULL;
  
 -static const char write_tree_usage[] = "git-write-tree [--missing-ok]";
 +static const char write_tree_usage[] =
 +"git-write-tree [--missing-ok] [--prefix=<prefix>/]";
  
- static struct cache_file cache_file;
+ static struct lock_file lock_file;
  
  int main(int argc, char **argv)
  {
  
        setup_git_directory();
  
-       newfd = hold_index_file_for_update(&cache_file, get_index_file());
+       newfd = hold_lock_file_for_update(&lock_file, get_index_file());
        entries = read_cache();
 -      if (argc == 2) {
 -              if (!strcmp(argv[1], "--missing-ok"))
 +
 +      while (1 < argc) {
 +              char *arg = argv[1];
 +              if (!strcmp(arg, "--missing-ok"))
                        missing_ok = 1;
 +              else if (!strncmp(arg, "--prefix=", 9))
 +                      prefix = arg + 9;
                else
                        die(write_tree_usage);
 +              argc--; argv++;
        }
 -      
 +
        if (argc > 2)
                die("too many options");