admin管理员组文章数量:1405323
I got this merge conflict:
my $schema = $translator->schema;
my @tables = sort { ($result->{tables}{$a}{'order'} || 0) <=> ($result->{tables}{$b}{'order'} || 0) }
keys %{ $result->{tables} };
<<<<<<< HEAD
for my $table_name (@tables) {
my $tdata = $result->{tables}{$table_name};
my $table = $schema->add_table(
| parent of 1bfbcdad (Introduce and use Postgres in-database schemas)
for my $table_name ( @tables ) {
my $tdata = $result->{tables}{ $table_name };
my $table = $schema->add_table(
#schema => $tdata->{'schema_name'},
name => $tdata->{'table_name'},
) or die "Couldn't create table '$table_name': " . $schema->error;
=======
for my $table_name ( @tables ) {
my $tdata = $result->{tables}{ $table_name };
my $table = $schema->add_table(
schema_qualifier => $tdata->{'schema_name'},
name => $tdata->{'table_name'},
) or die "Couldn't create table '$table_name': " . $schema->error;
>>>>>>> 1bfbcdad (Introduce and use Postgres in-database schemas)
#schema => $tdata->{'schema_name'},
name => $tdata->{'table_name'},
) or die "Couldn't create table '$table_name': " . $schema->error;
$table->extra(temporary => 1) if $tdata->{'temporary'};
I expect that this part will be at HEAD
section:
#schema => $tdata->{'schema_name'},
name => $tdata->{'table_name'},
) or die "Couldn't create table '$table_name': " . $schema->error;
like this:
my $schema = $translator->schema;
my @tables = sort { ($result->{tables}{$a}{'order'} || 0) <=> ($result->{tables}{$b}{'order'} || 0) }
keys %{ $result->{tables} };
<<<<<<< HEAD
for my $table_name (@tables) {
my $tdata = $result->{tables}{$table_name};
my $table = $schema->add_table(
#schema => $tdata->{'schema_name'},
name => $tdata->{'table_name'},
) or die "Couldn't create table '$table_name': " . $schema->error;
| parent of 1bfbcdad (Introduce and use Postgres in-database schemas)
for my $table_name ( @tables ) {
my $tdata = $result->{tables}{ $table_name };
my $table = $schema->add_table(
#schema => $tdata->{'schema_name'},
name => $tdata->{'table_name'},
) or die "Couldn't create table '$table_name': " . $schema->error;
=======
for my $table_name ( @tables ) {
my $tdata = $result->{tables}{ $table_name };
my $table = $schema->add_table(
schema_qualifier => $tdata->{'schema_name'},
name => $tdata->{'table_name'},
) or die "Couldn't create table '$table_name': " . $schema->error;
>>>>>>> 1bfbcdad (Introduce and use Postgres in-database schemas)
$table->extra(temporary => 1) if $tdata->{'temporary'};
Otherwise if I resolve this conflict by keeping theirs
change that part of code will be duplicated:
my $schema = $translator->schema;
my @tables = sort { ($result->{tables}{$a}{'order'} || 0) <=> ($result->{tables}{$b}{'order'} || 0) }
keys %{ $result->{tables} };
for my $table_name ( @tables ) {
my $tdata = $result->{tables}{ $table_name };
my $table = $schema->add_table(
schema_qualifier => $tdata->{'schema_name'},
name => $tdata->{'table_name'},
) or die "Couldn't create table '$table_name': " . $schema->error;
#schema => $tdata->{'schema_name'},
name => $tdata->{'table_name'},
) or die "Couldn't create table '$table_name': " . $schema->error;
$table->extra(temporary => 1) if $tdata->{'temporary'};
Why this happens? And are there any options to prevent this to occur? Thank you
PS. git version 2.49.0
UPD
Here is another similar example, but now the duplicated code is before the merge conflict block (actually this is not expected diff and wrong):
my ($from_field, $to_field, $options) = @_;
die "Can't alter field in another table"
if ($from_field->table->name ne $to_field->table->name);
<<<<<<< HEAD
my $generator = _generator($options);
my @out;
| parent of 1bfbcdad (Introduce and use Postgres in-database schemas)
die "Can't alter field in another table"
if($from_field->table->name ne $to_field->table->name);
=======
die "Can't alter field in another table"
if($from_field->table->qualified_name ne $to_field->table->qualified_name);
>>>>>>> 1bfbcdad (Introduce and use Postgres in-database schemas)
# drop geometry column and constraints
push @out, drop_geometry_column($from_field, $options), drop_geometry_constraints($from_field, $options),
if is_geometry($from_field);
本文标签: Why git diff during conflict move out and duplicate some codeStack Overflow
版权声明:本文标题:Why git diff during conflict move out and duplicate some code? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744301767a2599616.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论