1
0
mirror of https://github.com/git/git synced 2024-07-04 16:48:40 +00:00

Revert "Merge branch 'en/rename-directory-detection'"

This reverts commit e4bb62fa1e, reversing
changes made to 468165c1d8.

The topic appears to inflict severe regression in renaming merges,
even though the promise of it was that it would improve them.

We do not yet know which exact change in the topic was wrong, but in
the meantime, let's play it safe and revert it out of 'master'
before real Git-using projects are harmed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2018-04-11 18:07:11 +09:00
parent 26e47e261e
commit 8b026edac3
9 changed files with 115 additions and 5197 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
#ifndef MERGE_RECURSIVE_H
#define MERGE_RECURSIVE_H
#include "unpack-trees.h"
#include "string-list.h"
struct merge_options {
@ -28,32 +27,6 @@ struct merge_options {
struct strbuf obuf;
struct hashmap current_file_dir_set;
struct string_list df_conflict_file_set;
struct unpack_trees_options unpack_opts;
};
/*
* For dir_rename_entry, directory names are stored as a full path from the
* toplevel of the repository and do not include a trailing '/'. Also:
*
* dir: original name of directory being renamed
* non_unique_new_dir: if true, could not determine new_dir
* new_dir: final name of directory being renamed
* possible_new_dirs: temporary used to help determine new_dir; see comments
* in get_directory_renames() for details
*/
struct dir_rename_entry {
struct hashmap_entry ent; /* must be the first member! */
char *dir;
unsigned non_unique_new_dir:1;
struct strbuf new_dir;
struct string_list possible_new_dirs;
};
struct collision_entry {
struct hashmap_entry ent; /* must be the first member! */
char *target_file;
struct string_list source_files;
unsigned reported_already:1;
};
/* merge_trees() but with recursive ancestor consolidation */

View File

@ -1,6 +1,5 @@
#include "cache.h"
#include "refs.h"
#include "string-list.h"
#include "utf8.h"
int starts_with(const char *str, const char *prefix)
@ -172,21 +171,6 @@ struct strbuf **strbuf_split_buf(const char *str, size_t slen,
return ret;
}
void strbuf_add_separated_string_list(struct strbuf *str,
const char *sep,
struct string_list *slist)
{
struct string_list_item *item;
int sep_needed = 0;
for_each_string_list_item(item, slist) {
if (sep_needed)
strbuf_addstr(str, sep);
strbuf_addstr(str, item->string);
sep_needed = 1;
}
}
void strbuf_list_free(struct strbuf **sbs)
{
struct strbuf **s = sbs;

View File

@ -1,8 +1,6 @@
#ifndef STRBUF_H
#define STRBUF_H
struct string_list;
/**
* strbuf's are meant to be used with all the usual C string and memory
* APIs. Given that the length of the buffer is known, it's often better to
@ -539,20 +537,6 @@ static inline struct strbuf **strbuf_split(const struct strbuf *sb,
return strbuf_split_max(sb, terminator, 0);
}
/*
* Adds all strings of a string list to the strbuf, separated by the given
* separator. For example, if sep is
* ', '
* and slist contains
* ['element1', 'element2', ..., 'elementN'],
* then write:
* 'element1, element2, ..., elementN'
* to str. If only one element, just write "element1" to str.
*/
extern void strbuf_add_separated_string_list(struct strbuf *str,
const char *sep,
struct string_list *slist);
/**
* Free a NULL-terminated list of strbufs (for example, the return
* values of the strbuf_split*() functions).

View File

@ -141,7 +141,7 @@ test_expect_success 'cherry-pick "-" works with arguments' '
test_cmp expect actual
'
test_expect_success 'cherry-pick works with dirty renamed file' '
test_expect_failure 'cherry-pick works with dirty renamed file' '
test_commit to-rename &&
git checkout -b unrelated &&
test_commit unrelated &&

File diff suppressed because it is too large Load Diff

View File

@ -92,7 +92,7 @@ test_expect_success 'will not overwrite removed file with staged changes' '
test_cmp important c1.c
'
test_expect_success 'will not overwrite unstaged changes in renamed file' '
test_expect_failure 'will not overwrite unstaged changes in renamed file' '
git reset --hard c1 &&
git mv c1.c other.c &&
git commit -m rename &&

View File

@ -1509,8 +1509,8 @@ static int verify_uptodate_1(const struct cache_entry *ce,
add_rejected_path(o, error_type, ce->name);
}
int verify_uptodate(const struct cache_entry *ce,
struct unpack_trees_options *o)
static int verify_uptodate(const struct cache_entry *ce,
struct unpack_trees_options *o)
{
if (!o->skip_sparse_checkout && (ce->ce_flags & CE_NEW_SKIP_WORKTREE))
return 0;

View File

@ -1,7 +1,6 @@
#ifndef UNPACK_TREES_H
#define UNPACK_TREES_H
#include "tree-walk.h"
#include "string-list.h"
#define MAX_UNPACK_TREES 8
@ -79,9 +78,6 @@ struct unpack_trees_options {
extern int unpack_trees(unsigned n, struct tree_desc *t,
struct unpack_trees_options *options);
int verify_uptodate(const struct cache_entry *ce,
struct unpack_trees_options *o);
int threeway_merge(const struct cache_entry * const *stages,
struct unpack_trees_options *o);
int twoway_merge(const struct cache_entry * const *src,