From: Junio C Hamano Date: Wed, 11 Mar 2009 20:48:31 +0000 (-0700) Subject: Merge branch 'jk/clone-post-checkout' X-Git-Tag: v1.6.3-rc0~173 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8a396c02fdc7efa787be20074ae08059e3f80d14?ds=inline;hp=-c Merge branch 'jk/clone-post-checkout' * jk/clone-post-checkout: clone: run post-checkout hook when checking out --- 8a396c02fdc7efa787be20074ae08059e3f80d14 diff --combined builtin-clone.c index 92826cd14c,a6d89bc625..39523cee30 --- a/builtin-clone.c +++ b/builtin-clone.c @@@ -20,6 -20,7 +20,7 @@@ #include "dir.h" #include "pack-refs.h" #include "sigchain.h" + #include "run-command.h" /* * Overall FIXMEs: @@@ -365,6 -366,8 +366,6 @@@ static void install_branch_config(cons int cmd_clone(int argc, const char **argv, const char *prefix) { - int use_local_hardlinks = 1; - int use_separate_remote = 1; int is_bundle = 0; struct stat buf; const char *repo_name, *repo, *work_tree, *git_dir; @@@ -375,6 -378,7 +376,7 @@@ struct strbuf branch_top = STRBUF_INIT, reflog_msg = STRBUF_INIT; struct transport *transport = NULL; char *src_ref_prefix = "refs/heads/"; + int err = 0; struct refspec refspec; @@@ -386,6 -390,9 +388,6 @@@ if (argc == 0) die("You must specify a repository to clone."); - if (option_no_hardlinks) - use_local_hardlinks = 0; - if (option_mirror) option_bare = 1; @@@ -394,6 -401,7 +396,6 @@@ die("--bare and --origin %s options are incompatible.", option_origin); option_no_checkout = 1; - use_separate_remote = 0; } if (!option_origin) @@@ -625,6 -633,9 +627,9 @@@ if (write_cache(fd, active_cache, active_nr) || commit_locked_index(lock_file)) die("unable to write new index file"); + + err |= run_hook(NULL, "post-checkout", sha1_to_hex(null_sha1), + sha1_to_hex(remote_head->old_sha1), "1", NULL); } strbuf_release(&reflog_msg); @@@ -632,5 -643,5 +637,5 @@@ strbuf_release(&key); strbuf_release(&value); junk_pid = 0; - return 0; + return err; }