Merge branch 'maint'
* maint: blame: correctly handle a path that used to be a directory add -i: do not dump patch during application Update draft release notes for 1.6.3.2 grep: fix colouring of matches with zero length Documentation: teach stash/pop workflow instead of stash/apply Change xdl_merge to generate output even for null merges t6023: merge-file fails to output anything for a degenerate merge
This commit is contained in:
@ -362,18 +362,28 @@ static struct origin *find_origin(struct scoreboard *sb,
|
||||
"", &diff_opts);
|
||||
diffcore_std(&diff_opts);
|
||||
|
||||
/* It is either one entry that says "modified", or "created",
|
||||
* or nothing.
|
||||
*/
|
||||
if (!diff_queued_diff.nr) {
|
||||
/* The path is the same as parent */
|
||||
porigin = get_origin(sb, parent, origin->path);
|
||||
hashcpy(porigin->blob_sha1, origin->blob_sha1);
|
||||
}
|
||||
else if (diff_queued_diff.nr != 1)
|
||||
die("internal error in blame::find_origin");
|
||||
else {
|
||||
struct diff_filepair *p = diff_queued_diff.queue[0];
|
||||
} else {
|
||||
/*
|
||||
* Since origin->path is a pathspec, if the parent
|
||||
* commit had it as a directory, we will see a whole
|
||||
* bunch of deletion of files in the directory that we
|
||||
* do not care about.
|
||||
*/
|
||||
int i;
|
||||
struct diff_filepair *p = NULL;
|
||||
for (i = 0; i < diff_queued_diff.nr; i++) {
|
||||
const char *name;
|
||||
p = diff_queued_diff.queue[i];
|
||||
name = p->one->path ? p->one->path : p->two->path;
|
||||
if (!strcmp(name, origin->path))
|
||||
break;
|
||||
}
|
||||
if (!p)
|
||||
die("internal error in blame::find_origin");
|
||||
switch (p->status) {
|
||||
default:
|
||||
die("internal error in blame::find_origin (%c)",
|
||||
|
||||
Reference in New Issue
Block a user