GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #1382 from arrbee/fix-diff-patch-a-different-way · libgit2/libgit2@01be786

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • config.c
  • tests-clar/diff
    • patch.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/config.c‎

Copy file name to clipboardExpand all lines: src/config.c
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,6 @@ static int get_string(const char **out, const git_config *cfg, const char *name)
426426
file_internal *internal;
427427
unsigned int i;
428428

429-
assert(cfg->files.length);
430-
431429
git_vector_foreach(&cfg->files, i, internal) {
432430
int res = get_string_at_file(out, internal->file, name);
433431

@@ -466,8 +464,6 @@ int git_config_get_entry(const git_config_entry **out, const git_config *cfg, co
466464
file_internal *internal;
467465
unsigned int i;
468466

469-
assert(cfg->files.length);
470-
471467
*out = NULL;
472468

473469
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
488484
int ret = GIT_ENOTFOUND;
489485
size_t i;
490486

491-
assert(cfg->files.length);
492-
493487
/*
494488
* This loop runs the "wrong" way 'round because we need to
495489
* look at every value from the most general to most specific
Collapse file

‎tests-clar/diff/patch.c‎

Copy file name to clipboardExpand all lines: tests-clar/diff/patch.c
+4-6Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,8 @@ void test_diff_patch__hunks_have_correct_line_numbers(void)
150150

151151
g_repo = cl_git_sandbox_init("renames");
152152

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);
156155

157156
cl_git_rewritefile("renames/songof7cities.txt", new_content);
158157

@@ -278,9 +277,8 @@ void test_diff_patch__line_counts_with_eofnl(void)
278277

279278
g_repo = cl_git_sandbox_init("renames");
280279

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);
284282

285283
cl_git_pass(git_futils_readbuffer(&content, "renames/songof7cities.txt"));
286284

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.