GeezerVison is showing github.com — Merge pull request #1382 from arrbee/fix-diff-patch-a-different-way · libgit2/libgit2@01be786
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/config.c -6Lines changed: 0 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -426,8 +426,6 @@ static int get_string(const char **out, const git_config *cfg, const char *name) | 426 | 426 | file_internal *internal; | 427 | 427 | unsigned int i; | 428 | 428 |
| 429 | | - assert(cfg->files.length); | 430 | | - | 431 | 429 | git_vector_foreach(&cfg->files, i, internal) { | 432 | 430 | int res = get_string_at_file(out, internal->file, name); | 433 | 431 |
| @@ -466,8 +464,6 @@ int git_config_get_entry(const git_config_entry **out, const git_config *cfg, co | 466 | 464 | file_internal *internal; | 467 | 465 | unsigned int i; | 468 | 466 |
| 469 | | - assert(cfg->files.length); | 470 | | - | 471 | 467 | *out = NULL; | 472 | 468 |
| 473 | 469 | git_vector_foreach(&cfg->files, i, internal) { | @@ -488,8 +484,6 @@ int git_config_get_multivar(const git_config *cfg, const char *name, const char | 488 | 484 | int ret = GIT_ENOTFOUND; | 489 | 485 | size_t i; | 490 | 486 |
| 491 | | - assert(cfg->files.length); | 492 | | - | 493 | 487 | /* | 494 | 488 | * This loop runs the "wrong" way 'round because we need to | 495 | 489 | * look at every value from the most general to most specific | |
Collapse file Copy file name to clipboardExpand all lines: tests-clar/diff/patch.c +4-6Lines changed: 4 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -150,9 +150,8 @@ void test_diff_patch__hunks_have_correct_line_numbers(void) | 150 | 150 |
| 151 | 151 | g_repo = cl_git_sandbox_init("renames"); | 152 | 152 |
| 153 | | - cl_git_pass(git_repository_config(&cfg, g_repo)); | 154 | | - cl_git_pass(git_config_set_bool(cfg, "core.autocrlf", false)); | 155 | | - git_config_free(cfg); | | 153 | + cl_git_pass(git_config_new(&cfg)); | | 154 | + git_repository_set_config(g_repo, cfg); | 156 | 155 |
| 157 | 156 | cl_git_rewritefile("renames/songof7cities.txt", new_content); | 158 | 157 |
| @@ -278,9 +277,8 @@ void test_diff_patch__line_counts_with_eofnl(void) | 278 | 277 |
| 279 | 278 | g_repo = cl_git_sandbox_init("renames"); | 280 | 279 |
| 281 | | - cl_git_pass(git_repository_config(&cfg, g_repo)); | 282 | | - cl_git_pass(git_config_set_bool(cfg, "core.autocrlf", false)); | 283 | | - git_config_free(cfg); | | 280 | + cl_git_pass(git_config_new(&cfg)); | | 281 | + git_repository_set_config(g_repo, cfg); | 284 | 282 |
| 285 | 283 | cl_git_pass(git_futils_readbuffer(&content, "renames/songof7cities.txt")); | 286 | 284 |
| |
|