Skip to content

Commit 8b026ed

Browse files
committed
Revert "Merge branch 'en/rename-directory-detection'"
This reverts commit e4bb62f, reversing changes made to 468165c. 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 <[email protected]>
1 parent 26e47e2 commit 8b026ed

9 files changed

+115
-5197
lines changed

merge-recursive.c

Lines changed: 111 additions & 1132 deletions
Large diffs are not rendered by default.

merge-recursive.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef MERGE_RECURSIVE_H
22
#define MERGE_RECURSIVE_H
33

4-
#include "unpack-trees.h"
54
#include "string-list.h"
65

76
struct merge_options {
@@ -28,32 +27,6 @@ struct merge_options {
2827
struct strbuf obuf;
2928
struct hashmap current_file_dir_set;
3029
struct string_list df_conflict_file_set;
31-
struct unpack_trees_options unpack_opts;
32-
};
33-
34-
/*
35-
* For dir_rename_entry, directory names are stored as a full path from the
36-
* toplevel of the repository and do not include a trailing '/'. Also:
37-
*
38-
* dir: original name of directory being renamed
39-
* non_unique_new_dir: if true, could not determine new_dir
40-
* new_dir: final name of directory being renamed
41-
* possible_new_dirs: temporary used to help determine new_dir; see comments
42-
* in get_directory_renames() for details
43-
*/
44-
struct dir_rename_entry {
45-
struct hashmap_entry ent; /* must be the first member! */
46-
char *dir;
47-
unsigned non_unique_new_dir:1;
48-
struct strbuf new_dir;
49-
struct string_list possible_new_dirs;
50-
};
51-
52-
struct collision_entry {
53-
struct hashmap_entry ent; /* must be the first member! */
54-
char *target_file;
55-
struct string_list source_files;
56-
unsigned reported_already:1;
5730
};
5831

5932
/* merge_trees() but with recursive ancestor consolidation */

strbuf.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "cache.h"
22
#include "refs.h"
3-
#include "string-list.h"
43
#include "utf8.h"
54

65
int starts_with(const char *str, const char *prefix)
@@ -172,21 +171,6 @@ struct strbuf **strbuf_split_buf(const char *str, size_t slen,
172171
return ret;
173172
}
174173

175-
void strbuf_add_separated_string_list(struct strbuf *str,
176-
const char *sep,
177-
struct string_list *slist)
178-
{
179-
struct string_list_item *item;
180-
int sep_needed = 0;
181-
182-
for_each_string_list_item(item, slist) {
183-
if (sep_needed)
184-
strbuf_addstr(str, sep);
185-
strbuf_addstr(str, item->string);
186-
sep_needed = 1;
187-
}
188-
}
189-
190174
void strbuf_list_free(struct strbuf **sbs)
191175
{
192176
struct strbuf **s = sbs;

strbuf.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef STRBUF_H
22
#define STRBUF_H
33

4-
struct string_list;
5-
64
/**
75
* strbuf's are meant to be used with all the usual C string and memory
86
* 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,
539537
return strbuf_split_max(sb, terminator, 0);
540538
}
541539

542-
/*
543-
* Adds all strings of a string list to the strbuf, separated by the given
544-
* separator. For example, if sep is
545-
* ', '
546-
* and slist contains
547-
* ['element1', 'element2', ..., 'elementN'],
548-
* then write:
549-
* 'element1, element2, ..., elementN'
550-
* to str. If only one element, just write "element1" to str.
551-
*/
552-
extern void strbuf_add_separated_string_list(struct strbuf *str,
553-
const char *sep,
554-
struct string_list *slist);
555-
556540
/**
557541
* Free a NULL-terminated list of strbufs (for example, the return
558542
* values of the strbuf_split*() functions).

t/t3501-revert-cherry-pick.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ test_expect_success 'cherry-pick "-" works with arguments' '
141141
test_cmp expect actual
142142
'
143143

144-
test_expect_success 'cherry-pick works with dirty renamed file' '
144+
test_expect_failure 'cherry-pick works with dirty renamed file' '
145145
test_commit to-rename &&
146146
git checkout -b unrelated &&
147147
test_commit unrelated &&

0 commit comments

Comments
 (0)