Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-21 16:57:48 +0300
committerJunio C Hamano <gitster@pobox.com>2018-11-21 16:57:48 +0300
commit254db3035ccf3413ab997c4baf2d3b8b7bb4c054 (patch)
tree1e075b41ab27ffcf15fb5c30159a518f69ccb185
parentf1814e02282860a85b0ca85092df08b4788103da (diff)
parent3e73cc62c0d80fedd1fc612e256b5eb3f3068de4 (diff)
Merge branch 'en/status-multiple-renames-to-the-same-target-fix' into maint
The code in "git status" sometimes hit an assertion failure. This was caused by a structure that was reused without cleaning the data used for the first run, which has been corrected. * en/status-multiple-renames-to-the-same-target-fix: commit: fix erroneous BUG, 'multiple renames on the same target? how?'
-rw-r--r--builtin/commit.c1
-rwxr-xr-xt/t7500-commit.sh23
2 files changed, 24 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 0d9828e29e..83233ca1a5 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -872,6 +872,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
s->use_color = 0;
commitable = run_status(s->fp, index_file, prefix, 1, s);
s->use_color = saved_color_setting;
+ string_list_clear(&s->change, 1);
} else {
struct object_id oid;
const char *parent = "HEAD";
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 170b4810e0..31ab608b67 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -359,4 +359,27 @@ test_expect_success 'new line found before status message in commit template' '
test_i18ncmp expected-template editor-input
'
+test_expect_success 'setup empty commit with unstaged rename and copy' '
+ test_create_repo unstaged_rename_and_copy &&
+ (
+ cd unstaged_rename_and_copy &&
+
+ echo content >orig &&
+ git add orig &&
+ test_commit orig &&
+
+ cp orig new_copy &&
+ mv orig new_rename &&
+ git add -N new_copy new_rename
+ )
+'
+
+test_expect_success 'check commit with unstaged rename and copy' '
+ (
+ cd unstaged_rename_and_copy &&
+
+ test_must_fail git -c diff.renames=copy commit
+ )
+'
+
test_done