diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2017-12-27 17:18:39 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-27 12:38:35 -0800 |
commit | 176ea747930908669200520ae14f9dbc61cf0d40 (patch) | |
tree | 38244c873d3d4a9beba07b42d64511853258f750 /list-objects.h | |
parent | wt-status.c: rename rename-related fields in wt_status_change_data (diff) | |
download | tgif-176ea747930908669200520ae14f9dbc61cf0d40.tar.xz |
wt-status.c: handle worktree renames
Before 425a28e0a4 (diff-lib: allow ita entries treated as "not yet exist
in index" - 2016-10-24) there are never "new files" in the index, which
essentially disables rename detection because we only detect renames
when a new file appears in a diff pair.
After that commit, an i-t-a entry can appear as a new file in "git
diff-files". But the diff callback function in wt-status.c does not
handle this case and produces incorrect status output.
PS. The reader may notice that this patch adds a new xstrdup() but not
a free(). Yes we leak memory (the same for head_path). But wt_status
so far has been short lived, this leak should not matter in
practice.
Noticed-by: Alex Vandiver <alexmv@dropbox.com>
Helped-by: Igor Djordjevic <igor.d.djordjevic@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list-objects.h')
0 files changed, 0 insertions, 0 deletions