attr: rename internal attr file source enum The enum `git_attr_file_source` is better suffixed with a `_t` since it's a type-of source. Similarly, its members should have a matching name.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
diff --git a/src/attr.c b/src/attr.c
index cab5e8b..a8848ca 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -256,7 +256,7 @@ cleanup:
static int preload_attr_file(
git_repository *repo,
git_attr_session *attr_session,
- git_attr_file_source source,
+ git_attr_file_source_t source_type,
const char *base,
const char *file,
bool allow_macros)
@@ -266,8 +266,10 @@ static int preload_attr_file(
if (!file)
return 0;
- if (!(error = git_attr_cache__get(&preload, repo, attr_session, source, base, file,
- git_attr_file__parse_buffer, allow_macros)))
+ if (!(error = git_attr_cache__get(&preload, repo, attr_session,
+ source_type, base, file,
+ git_attr_file__parse_buffer,
+ allow_macros)))
git_attr_file__free(preload);
return error;
@@ -333,36 +335,36 @@ static int attr_setup(
*/
if ((error = system_attr_file(&path, attr_session)) < 0 ||
- (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE__FROM_FILE,
+ (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE_SOURCE_FILE,
NULL, path.ptr, true)) < 0) {
if (error != GIT_ENOTFOUND)
goto out;
}
- if ((error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE__FROM_FILE,
+ if ((error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE_SOURCE_FILE,
NULL, git_repository_attr_cache(repo)->cfg_attr_file, true)) < 0)
goto out;
git_buf_clear(&path); /* git_repository_item_path expects an empty buffer, because it uses git_buf_set */
if ((error = git_repository_item_path(&path, repo, GIT_REPOSITORY_ITEM_INFO)) < 0 ||
- (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE__FROM_FILE,
+ (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE_SOURCE_FILE,
path.ptr, GIT_ATTR_FILE_INREPO, true)) < 0) {
if (error != GIT_ENOTFOUND)
goto out;
}
if ((workdir = git_repository_workdir(repo)) != NULL &&
- (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE__FROM_FILE,
+ (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE_SOURCE_FILE,
workdir, GIT_ATTR_FILE, true)) < 0)
goto out;
if ((error = git_repository_index__weakptr(&idx, repo)) < 0 ||
- (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE__FROM_INDEX,
+ (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE_SOURCE_INDEX,
NULL, GIT_ATTR_FILE, true)) < 0)
goto out;
if ((flags & GIT_ATTR_CHECK_INCLUDE_HEAD) != 0 &&
- (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE__FROM_HEAD,
+ (error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE_SOURCE_HEAD,
NULL, GIT_ATTR_FILE, true)) < 0)
goto out;
@@ -422,31 +424,34 @@ typedef struct {
} attr_walk_up_info;
static int attr_decide_sources(
- uint32_t flags, bool has_wd, bool has_index, git_attr_file_source *srcs)
+ uint32_t flags,
+ bool has_wd,
+ bool has_index,
+ git_attr_file_source_t *srcs)
{
int count = 0;
switch (flags & 0x03) {
case GIT_ATTR_CHECK_FILE_THEN_INDEX:
if (has_wd)
- srcs[count++] = GIT_ATTR_FILE__FROM_FILE;
+ srcs[count++] = GIT_ATTR_FILE_SOURCE_FILE;
if (has_index)
- srcs[count++] = GIT_ATTR_FILE__FROM_INDEX;
+ srcs[count++] = GIT_ATTR_FILE_SOURCE_INDEX;
break;
case GIT_ATTR_CHECK_INDEX_THEN_FILE:
if (has_index)
- srcs[count++] = GIT_ATTR_FILE__FROM_INDEX;
+ srcs[count++] = GIT_ATTR_FILE_SOURCE_INDEX;
if (has_wd)
- srcs[count++] = GIT_ATTR_FILE__FROM_FILE;
+ srcs[count++] = GIT_ATTR_FILE_SOURCE_FILE;
break;
case GIT_ATTR_CHECK_INDEX_ONLY:
if (has_index)
- srcs[count++] = GIT_ATTR_FILE__FROM_INDEX;
+ srcs[count++] = GIT_ATTR_FILE_SOURCE_INDEX;
break;
}
if ((flags & GIT_ATTR_CHECK_INCLUDE_HEAD) != 0)
- srcs[count++] = GIT_ATTR_FILE__FROM_HEAD;
+ srcs[count++] = GIT_ATTR_FILE_SOURCE_HEAD;
return count;
}
@@ -455,7 +460,7 @@ static int push_attr_file(
git_repository *repo,
git_attr_session *attr_session,
git_vector *list,
- git_attr_file_source source,
+ git_attr_file_source_t source_type,
const char *base,
const char *filename,
bool allow_macros)
@@ -464,7 +469,9 @@ static int push_attr_file(
git_attr_file *file = NULL;
error = git_attr_cache__get(&file, repo, attr_session,
- source, base, filename, git_attr_file__parse_buffer, allow_macros);
+ source_type, base, filename,
+ git_attr_file__parse_buffer,
+ allow_macros);
if (error < 0)
return error;
@@ -480,7 +487,7 @@ static int push_attr_file(
static int push_one_attr(void *ref, const char *path)
{
attr_walk_up_info *info = (attr_walk_up_info *)ref;
- git_attr_file_source src[GIT_ATTR_FILE_NUM_SOURCES];
+ git_attr_file_source_t src[GIT_ATTR_FILE_NUM_SOURCES];
int error = 0, n_src, i;
bool allow_macros;
@@ -542,7 +549,7 @@ static int collect_attr_files(
*/
if ((error = git_repository_item_path(&attrfile, repo, GIT_REPOSITORY_ITEM_INFO)) < 0 ||
- (error = push_attr_file(repo, attr_session, files, GIT_ATTR_FILE__FROM_FILE,
+ (error = push_attr_file(repo, attr_session, files, GIT_ATTR_FILE_SOURCE_FILE,
attrfile.ptr, GIT_ATTR_FILE_INREPO, true)) < 0) {
if (error != GIT_ENOTFOUND)
goto cleanup;
@@ -565,7 +572,7 @@ static int collect_attr_files(
goto cleanup;
if (git_repository_attr_cache(repo)->cfg_attr_file != NULL) {
- error = push_attr_file(repo, attr_session, files, GIT_ATTR_FILE__FROM_FILE,
+ error = push_attr_file(repo, attr_session, files, GIT_ATTR_FILE_SOURCE_FILE,
NULL, git_repository_attr_cache(repo)->cfg_attr_file, true);
if (error < 0)
goto cleanup;
@@ -575,7 +582,7 @@ static int collect_attr_files(
error = system_attr_file(&dir, attr_session);
if (!error)
- error = push_attr_file(repo, attr_session, files, GIT_ATTR_FILE__FROM_FILE,
+ error = push_attr_file(repo, attr_session, files, GIT_ATTR_FILE_SOURCE_FILE,
NULL, dir.ptr, true);
else if (error == GIT_ENOTFOUND)
error = 0;
diff --git a/src/attr_file.c b/src/attr_file.c
index 8269272..f6f1d33 100644
--- a/src/attr_file.c
+++ b/src/attr_file.c
@@ -33,7 +33,7 @@ static void attr_file_free(git_attr_file *file)
int git_attr_file__new(
git_attr_file **out,
git_attr_file_entry *entry,
- git_attr_file_source source)
+ git_attr_file_source_t source_type)
{
git_attr_file *attrs = git__calloc(1, sizeof(git_attr_file));
GIT_ERROR_CHECK_ALLOC(attrs);
@@ -47,8 +47,8 @@ int git_attr_file__new(
goto on_error;
GIT_REFCOUNT_INC(attrs);
- attrs->entry = entry;
- attrs->source = source;
+ attrs->entry = entry;
+ attrs->source_type = source_type;
*out = attrs;
return 0;
@@ -108,7 +108,7 @@ int git_attr_file__load(
git_repository *repo,
git_attr_session *attr_session,
git_attr_file_entry *entry,
- git_attr_file_source source,
+ git_attr_file_source_t source_type,
git_attr_file_parser parser,
bool allow_macros)
{
@@ -128,11 +128,11 @@ int git_attr_file__load(
*out = NULL;
- switch (source) {
- case GIT_ATTR_FILE__IN_MEMORY:
+ switch (source_type) {
+ case GIT_ATTR_FILE_SOURCE_MEMORY:
/* in-memory attribute file doesn't need data */
break;
- case GIT_ATTR_FILE__FROM_INDEX: {
+ case GIT_ATTR_FILE_SOURCE_INDEX: {
if ((error = attr_file_oid_from_index(&id, repo, entry->path)) < 0 ||
(error = git_blob_lookup(&blob, repo, &id)) < 0)
return error;
@@ -145,7 +145,7 @@ int git_attr_file__load(
git_buf_put(&content, git_blob_rawcontent(blob), (size_t)blobsize);
break;
}
- case GIT_ATTR_FILE__FROM_FILE: {
+ case GIT_ATTR_FILE_SOURCE_FILE: {
int fd = -1;
/* For open or read errors, pretend that we got ENOTFOUND. */
@@ -162,7 +162,7 @@ int git_attr_file__load(
break;
}
- case GIT_ATTR_FILE__FROM_HEAD: {
+ case GIT_ATTR_FILE_SOURCE_HEAD: {
if ((error = git_repository_head_tree(&tree, repo)) < 0 ||
(error = git_tree_entry_bypath(&tree_entry, tree, entry->path)) < 0 ||
(error = git_blob_lookup(&blob, repo, git_tree_entry_id(tree_entry))) < 0)
@@ -182,11 +182,11 @@ int git_attr_file__load(
break;
}
default:
- git_error_set(GIT_ERROR_INVALID, "unknown file source %d", source);
+ git_error_set(GIT_ERROR_INVALID, "unknown file source %d", source_type);
return -1;
}
- if ((error = git_attr_file__new(&file, entry, source)) < 0)
+ if ((error = git_attr_file__new(&file, entry, source_type)) < 0)
goto cleanup;
/* advance over a UTF8 BOM */
@@ -210,11 +210,11 @@ int git_attr_file__load(
/* write cache breakers */
if (nonexistent)
file->nonexistent = 1;
- else if (source == GIT_ATTR_FILE__FROM_INDEX)
+ else if (source_type == GIT_ATTR_FILE_SOURCE_INDEX)
git_oid_cpy(&file->cache_data.oid, git_blob_id(blob));
- else if (source == GIT_ATTR_FILE__FROM_HEAD)
+ else if (source_type == GIT_ATTR_FILE_SOURCE_HEAD)
git_oid_cpy(&file->cache_data.oid, git_tree_id(tree));
- else if (source == GIT_ATTR_FILE__FROM_FILE)
+ else if (source_type == GIT_ATTR_FILE_SOURCE_FILE)
git_futils_filestamp_set_from_stat(&file->cache_data.stamp, &st);
/* else always cacheable */
@@ -245,15 +245,15 @@ int git_attr_file__out_of_date(
else if (file->nonexistent)
return 1;
- switch (file->source) {
- case GIT_ATTR_FILE__IN_MEMORY:
+ switch (file->source_type) {
+ case GIT_ATTR_FILE_SOURCE_MEMORY:
return 0;
- case GIT_ATTR_FILE__FROM_FILE:
+ case GIT_ATTR_FILE_SOURCE_FILE:
return git_futils_filestamp_check(
&file->cache_data.stamp, file->entry->fullpath);
- case GIT_ATTR_FILE__FROM_INDEX: {
+ case GIT_ATTR_FILE_SOURCE_INDEX: {
int error;
git_oid id;
@@ -264,7 +264,7 @@ int git_attr_file__out_of_date(
return (git_oid__cmp(&file->cache_data.oid, &id) != 0);
}
- case GIT_ATTR_FILE__FROM_HEAD: {
+ case GIT_ATTR_FILE_SOURCE_HEAD: {
git_tree *tree;
int error;
@@ -278,7 +278,7 @@ int git_attr_file__out_of_date(
}
default:
- git_error_set(GIT_ERROR_INVALID, "invalid file type %d", file->source);
+ git_error_set(GIT_ERROR_INVALID, "invalid file type %d", file->source_type);
return -1;
}
}
@@ -400,7 +400,7 @@ int git_attr_file__load_standalone(git_attr_file **out, const char *path)
* don't have to free it - freeing file+pool will free cache entry, too.
*/
- if ((error = git_attr_file__new(&file, NULL, GIT_ATTR_FILE__FROM_FILE)) < 0 ||
+ if ((error = git_attr_file__new(&file, NULL, GIT_ATTR_FILE_SOURCE_FILE)) < 0 ||
(error = git_attr_file__parse_buffer(NULL, file, content.ptr, true)) < 0 ||
(error = git_attr_cache__alloc_file_entry(&file->entry, NULL, NULL, path, &file->pool)) < 0)
goto out;
diff --git a/src/attr_file.h b/src/attr_file.h
index 617436b..330aed3 100644
--- a/src/attr_file.h
+++ b/src/attr_file.h
@@ -37,13 +37,13 @@
(GIT_ATTR_FNMATCH_ALLOWSPACE | GIT_ATTR_FNMATCH_ALLOWNEG | GIT_ATTR_FNMATCH_ALLOWMACRO)
typedef enum {
- GIT_ATTR_FILE__IN_MEMORY = 0,
- GIT_ATTR_FILE__FROM_FILE = 1,
- GIT_ATTR_FILE__FROM_INDEX = 2,
- GIT_ATTR_FILE__FROM_HEAD = 3,
+ GIT_ATTR_FILE_SOURCE_MEMORY = 0,
+ GIT_ATTR_FILE_SOURCE_FILE = 1,
+ GIT_ATTR_FILE_SOURCE_INDEX = 2,
+ GIT_ATTR_FILE_SOURCE_HEAD = 3,
- GIT_ATTR_FILE_NUM_SOURCES = 4
-} git_attr_file_source;
+ GIT_ATTR_FILE_NUM_SOURCES = 4
+} git_attr_file_source_t;
extern const char *git_attr__true;
extern const char *git_attr__false;
@@ -81,7 +81,7 @@ typedef struct {
git_refcount rc;
git_mutex lock;
git_attr_file_entry *entry;
- git_attr_file_source source;
+ git_attr_file_source_t source_type;
git_vector rules; /* vector of <rule*> or <fnmatch*> */
git_pool pool;
unsigned int nonexistent:1;
@@ -142,7 +142,7 @@ typedef int (*git_attr_file_parser)(
int git_attr_file__new(
git_attr_file **out,
git_attr_file_entry *entry,
- git_attr_file_source source);
+ git_attr_file_source_t source_type);
void git_attr_file__free(git_attr_file *file);
@@ -151,7 +151,7 @@ int git_attr_file__load(
git_repository *repo,
git_attr_session *attr_session,
git_attr_file_entry *ce,
- git_attr_file_source source,
+ git_attr_file_source_t source_type,
git_attr_file_parser parser,
bool allow_macros);
diff --git a/src/attrcache.c b/src/attrcache.c
index 32513da..322e601 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -112,7 +112,7 @@ static int attr_cache_upsert(git_attr_cache *cache, git_attr_file *file)
* Replace the existing value if another thread has
* created it in the meantime.
*/
- old = git_atomic_swap(entry->file[file->source], file);
+ old = git_atomic_swap(entry->file[file->source_type], file);
if (old) {
GIT_REFCOUNT_OWN(old, NULL);
@@ -136,7 +136,7 @@ static int attr_cache_remove(git_attr_cache *cache, git_attr_file *file)
return error;
if ((entry = attr_cache_lookup_entry(cache, file->entry->path)) != NULL)
- old = git_atomic_compare_and_swap(&entry->file[file->source], file, NULL);
+ old = git_atomic_compare_and_swap(&entry->file[file->source_type], file, NULL);
attr_cache_unlock(cache);
@@ -158,7 +158,7 @@ static int attr_cache_lookup(
git_attr_file_entry **out_entry,
git_repository *repo,
git_attr_session *attr_session,
- git_attr_file_source source,
+ git_attr_file_source_t source_type,
const char *base,
const char *filename)
{
@@ -191,8 +191,8 @@ static int attr_cache_lookup(
entry = attr_cache_lookup_entry(cache, relfile);
if (!entry)
error = attr_cache_make_entry(&entry, repo, relfile);
- else if (entry->file[source] != NULL) {
- file = entry->file[source];
+ else if (entry->file[source_type] != NULL) {
+ file = entry->file[source_type];
GIT_REFCOUNT_INC(file);
}
@@ -210,7 +210,7 @@ int git_attr_cache__get(
git_attr_file **out,
git_repository *repo,
git_attr_session *attr_session,
- git_attr_file_source source,
+ git_attr_file_source_t source_type,
const char *base,
const char *filename,
git_attr_file_parser parser,
@@ -221,13 +221,15 @@ int git_attr_cache__get(
git_attr_file_entry *entry = NULL;
git_attr_file *file = NULL, *updated = NULL;
- if ((error = attr_cache_lookup(
- &file, &entry, repo, attr_session, source, base, filename)) < 0)
+ if ((error = attr_cache_lookup(&file, &entry, repo, attr_session,
+ source_type, base, filename)) < 0)
return error;
/* load file if we don't have one or if existing one is out of date */
if (!file || (error = git_attr_file__out_of_date(repo, attr_session, file)) > 0)
- error = git_attr_file__load(&updated, repo, attr_session, entry, source, parser, allow_macros);
+ error = git_attr_file__load(&updated, repo, attr_session,
+ entry, source_type, parser,
+ allow_macros);
/* if we loaded the file, insert into and/or update cache */
if (updated) {
@@ -260,7 +262,7 @@ int git_attr_cache__get(
bool git_attr_cache__is_cached(
git_repository *repo,
- git_attr_file_source source,
+ git_attr_file_source_t source_type,
const char *filename)
{
git_attr_cache *cache = git_repository_attr_cache(repo);
@@ -273,7 +275,7 @@ bool git_attr_cache__is_cached(
if ((entry = git_strmap_get(files, filename)) == NULL)
return false;
- return entry && (entry->file[source] != NULL);
+ return entry && (entry->file[source_type] != NULL);
}
diff --git a/src/attrcache.h b/src/attrcache.h
index 5e2fb29..6d1d968 100644
--- a/src/attrcache.h
+++ b/src/attrcache.h
@@ -31,7 +31,7 @@ extern int git_attr_cache__get(
git_attr_file **file,
git_repository *repo,
git_attr_session *attr_session,
- git_attr_file_source source,
+ git_attr_file_source_t source_type,
const char *base,
const char *filename,
git_attr_file_parser parser,
@@ -39,7 +39,7 @@ extern int git_attr_cache__get(
extern bool git_attr_cache__is_cached(
git_repository *repo,
- git_attr_file_source source,
+ git_attr_file_source_t source_type,
const char *path);
extern int git_attr_cache__alloc_file_entry(
diff --git a/src/ignore.c b/src/ignore.c
index 948c58d..db34289 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -250,8 +250,10 @@ static int push_ignore_file(
int error = 0;
git_attr_file *file = NULL;
- error = git_attr_cache__get(&file, ignores->repo, NULL, GIT_ATTR_FILE__FROM_FILE,
- base, filename, parse_ignore_file, false);
+ error = git_attr_cache__get(&file, ignores->repo, NULL,
+ GIT_ATTR_FILE_SOURCE_FILE, base,
+ filename, parse_ignore_file, false);
+
if (error < 0)
return error;
@@ -277,8 +279,9 @@ static int get_internal_ignores(git_attr_file **out, git_repository *repo)
if ((error = git_attr_cache__init(repo)) < 0)
return error;
- error = git_attr_cache__get(out, repo, NULL, GIT_ATTR_FILE__IN_MEMORY, NULL,
- GIT_IGNORE_INTERNAL, NULL, false);
+ error = git_attr_cache__get(out, repo, NULL,
+ GIT_ATTR_FILE_SOURCE_MEMORY, NULL,
+ GIT_IGNORE_INTERNAL, NULL, false);
/* if internal rules list is empty, insert default rules */
if (!error && !(*out)->rules.length)
diff --git a/tests/attr/repo.c b/tests/attr/repo.c
index 36beeb0..8224e5c 100644
--- a/tests/attr/repo.c
+++ b/tests/attr/repo.c
@@ -71,11 +71,11 @@ void test_attr_repo__get_one(void)
}
cl_assert(git_attr_cache__is_cached(
- g_repo, GIT_ATTR_FILE__FROM_FILE, ".git/info/attributes"));
+ g_repo, GIT_ATTR_FILE_SOURCE_FILE, ".git/info/attributes"));
cl_assert(git_attr_cache__is_cached(
- g_repo, GIT_ATTR_FILE__FROM_FILE, ".gitattributes"));
+ g_repo, GIT_ATTR_FILE_SOURCE_FILE, ".gitattributes"));
cl_assert(git_attr_cache__is_cached(
- g_repo, GIT_ATTR_FILE__FROM_FILE, "sub/.gitattributes"));
+ g_repo, GIT_ATTR_FILE_SOURCE_FILE, "sub/.gitattributes"));
}
void test_attr_repo__get_one_start_deep(void)
@@ -92,11 +92,11 @@ void test_attr_repo__get_one_start_deep(void)
}
cl_assert(git_attr_cache__is_cached(
- g_repo, GIT_ATTR_FILE__FROM_FILE, ".git/info/attributes"));
+ g_repo, GIT_ATTR_FILE_SOURCE_FILE, ".git/info/attributes"));
cl_assert(git_attr_cache__is_cached(
- g_repo, GIT_ATTR_FILE__FROM_FILE, ".gitattributes"));
+ g_repo, GIT_ATTR_FILE_SOURCE_FILE, ".gitattributes"));
cl_assert(git_attr_cache__is_cached(
- g_repo, GIT_ATTR_FILE__FROM_FILE, "sub/.gitattributes"));
+ g_repo, GIT_ATTR_FILE_SOURCE_FILE, "sub/.gitattributes"));
}
void test_attr_repo__get_many(void)
diff --git a/tests/ignore/status.c b/tests/ignore/status.c
index 188fbe4..83e821b 100644
--- a/tests/ignore/status.c
+++ b/tests/ignore/status.c
@@ -70,9 +70,9 @@ void test_ignore_status__0(void)
/* confirm that ignore files were cached */
cl_assert(git_attr_cache__is_cached(
- g_repo, GIT_ATTR_FILE__FROM_FILE, ".git/info/exclude"));
+ g_repo, GIT_ATTR_FILE_SOURCE_FILE, ".git/info/exclude"));
cl_assert(git_attr_cache__is_cached(
- g_repo, GIT_ATTR_FILE__FROM_FILE, ".gitignore"));
+ g_repo, GIT_ATTR_FILE_SOURCE_FILE, ".gitignore"));
}