Merge branch 'tb/t0027-raciness-fix' into jc/renormalize-merge-kill-safer-crlf
authorJunio C Hamano <gitster@pobox.com>
Thu, 1 Dec 2016 18:34:42 +0000 (10:34 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Dec 2016 18:34:42 +0000 (10:34 -0800)
* tb/t0027-raciness-fix:
convert: Correct NNO tests and missing `LF will be replaced by CRLF`

merge-recursive.c
t/t3501-revert-cherry-pick.sh
index de37e5153c791cb51fc77974edc30d0c44daf4d7..56385d4c01b732b77fdf463408109f8d3ca67be8 100644 (file)
@@ -213,6 +213,8 @@ static int add_cacheinfo(unsigned int mode, const unsigned char *sha1,
                struct cache_entry *nce;
 
                nce = refresh_cache_entry(ce, CE_MATCH_REFRESH | CE_MATCH_IGNORE_MISSING);
+               if (!nce)
+                       return error(_("addinfo_cache failed for path '%s'"), path);
                if (nce != ce)
                        ret = add_cache_entry(nce, options);
        }
index 51f3bbb8af446dd24a835a8593475b59a73f6d1f..22970d2223853a23da8d5ef4b5719c8c56028ff9 100755 (executable)
@@ -141,4 +141,16 @@ test_expect_success 'cherry-pick "-" works with arguments' '
        test_cmp expect actual
 '
 
+test_expect_success 'cherry-pick works with dirty renamed file' '
+       test_commit to-rename &&
+       git checkout -b unrelated &&
+       test_commit unrelated &&
+       git checkout @{-1} &&
+       git mv to-rename.t renamed &&
+       test_tick &&
+       git commit -m renamed &&
+       echo modified >renamed &&
+       git cherry-pick refs/heads/unrelated
+'
+
 test_done