diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-26 17:11:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-26 17:11:20 -0700 |
commit | 4e4baee3f44da26a5eaab27c76d597b04fef5259 (patch) | |
tree | 5d0ebb218dddd9fc17531ac75d140bf59eb056da /builtin/clone.c | |
parent | Merge branch 'hi/gpg-prefer-check-signature' (diff) | |
parent | t0021: test filter metadata for additional cases (diff) | |
download | tgif-4e4baee3f44da26a5eaab27c76d597b04fef5259.tar.xz |
Merge branch 'bc/filter-process'
Provide more information (e.g. the object of the tree-ish in which
the blob being converted appears, in addition to its path, which
has already been given) to smudge/clean conversion filters.
* bc/filter-process:
t0021: test filter metadata for additional cases
builtin/reset: compute checkout metadata for reset
builtin/rebase: compute checkout metadata for rebases
builtin/clone: compute checkout metadata for clones
builtin/checkout: compute checkout metadata for checkouts
convert: provide additional metadata to filters
convert: permit passing additional metadata to filter processes
builtin/checkout: pass branch info down to checkout_worktree
Diffstat (limited to 'builtin/clone.c')
-rw-r--r-- | builtin/clone.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 46573b9b7c..d8b1f413aa 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -784,11 +784,11 @@ static int checkout(int submodule_progress) if (!strcmp(head, "HEAD")) { if (advice_detached_head) detach_advice(oid_to_hex(&oid)); + FREE_AND_NULL(head); } else { if (!starts_with(head, "refs/heads/")) die(_("HEAD not found below refs/heads!")); } - free(head); /* We need to be in the new work tree for the checkout */ setup_work_tree(); @@ -803,6 +803,7 @@ static int checkout(int submodule_progress) opts.verbose_update = (option_verbosity >= 0); opts.src_index = &the_index; opts.dst_index = &the_index; + init_checkout_metadata(&opts.meta, head, &oid, NULL); tree = parse_tree_indirect(&oid); parse_tree(tree); @@ -810,6 +811,8 @@ static int checkout(int submodule_progress) if (unpack_trees(1, &t, &opts) < 0) die(_("unable to checkout working tree")); + free(head); + if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK)) die(_("unable to write new index file")); |