diff options
| author | Jiang Xin <worldhello.net@gmail.com> | 2021-08-14 07:56:22 +0800 |
|---|---|---|
| committer | Jiang Xin <worldhello.net@gmail.com> | 2021-08-14 07:56:22 +0800 |
| commit | 117e2caa42210de5c2c1ecfdf5d2bda056cd6f00 (patch) | |
| tree | c742277e7f21ad2746a807e2c0318a0fae662f5f /reset.c | |
| parent | 18c9fced7bf3feb3b326c73e2901e2ad05824c29 (diff) | |
| parent | 5d213e46bb7b880238ff5ea3914e940a50ae9369 (diff) | |
| download | git-117e2caa42210de5c2c1ecfdf5d2bda056cd6f00.tar.xz | |
Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (51 commits)
Git 2.33-rc2
object-file: use unsigned arithmetic with bit mask
Revert 'diff-merges: let "-m" imply "-p"'
object-store: avoid extra ';' from KHASH_INIT
oidtree: avoid nested struct oidtree_node
Git 2.33-rc1
test: fix for COLUMNS and bash 5
The eighth batch
diff: --pickaxe-all typofix
mingw: align symlinks-related rmdir() behavior with Linux
t7508: avoid non POSIX BRE
use fspathhash() everywhere
t0001: fix broken not-quite getcwd(3) test in bed67874e2
Documentation: render special characters correctly
reset: clear_unpack_trees_porcelain to plug leak
builtin/rebase: fix options.strategy memory lifecycle
builtin/merge: free found_ref when done
builtin/mv: free or UNLEAK multiple pointers at end of cmd_mv
convert: release strbuf to avoid leak
read-cache: call diff_setup_done to avoid leak
...
Diffstat (limited to 'reset.c')
| -rw-r--r-- | reset.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -21,7 +21,7 @@ int reset_head(struct repository *r, struct object_id *oid, const char *action, struct object_id head_oid; struct tree_desc desc[2] = { { NULL }, { NULL } }; struct lock_file lock = LOCK_INIT; - struct unpack_trees_options unpack_tree_opts; + struct unpack_trees_options unpack_tree_opts = { 0 }; struct tree *tree; const char *reflog_action; struct strbuf msg = STRBUF_INIT; @@ -49,7 +49,6 @@ int reset_head(struct repository *r, struct object_id *oid, const char *action, if (refs_only) goto reset_head_refs; - memset(&unpack_tree_opts, 0, sizeof(unpack_tree_opts)); setup_unpack_trees_porcelain(&unpack_tree_opts, action); unpack_tree_opts.head_idx = 1; unpack_tree_opts.src_index = r->index; @@ -134,6 +133,7 @@ reset_head_refs: leave_reset_head: strbuf_release(&msg); rollback_lock_file(&lock); + clear_unpack_trees_porcelain(&unpack_tree_opts); while (nr) free((void *)desc[--nr].buffer); return ret; |
