path: drop `git_path()` in favor of `repo_git_path()`
Remove `git_path()` in favor of the `repo_git_path()` family of functions, which makes the implicit dependency on `the_repository` go away. Note that `git_path()` returned a string allocated via `get_pathname()`, which uses a rotating set of statically allocated buffers. Consequently, callers didn't have to free the returned string. The same isn't true for `repo_common_path()`, so we also have to add logic to free the returned strings. This refactoring also allows us to remove `repo_common_pathv()` as well as `get_pathname()` from the public interface. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Feb 7, 2025 at 12:03 UTC
88dd321cfedc6ee190dfafe4670a83ea33cdf4a3
15 files changed
+128
-93
builtin/commit.c
+5
-3
@@ -352,6 +352,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
352
struct pathspec pathspec;
353
int refresh_flags = REFRESH_QUIET;
354
const char *ret;
355
+ char *path = NULL;
356
357
if (is_status)
358
refresh_flags |= REFRESH_UNMERGED;
@@ -524,9 +525,9 @@ static const char *prepare_index(const char **argv, const char *prefix,
525
if (write_locked_index(the_repository->index, &index_lock, 0))
526
die(_("unable to write new index file"));
527
527
- hold_lock_file_for_update(&false_lock,
528
- git_path("next-index-%"PRIuMAX,
529
- (uintmax_t) getpid()),
528
+ path = repo_git_path(the_repository, "next-index-%"PRIuMAX,
529
+ (uintmax_t) getpid());
530
+ hold_lock_file_for_update(&false_lock, path,
531
LOCK_DIE_ON_ERROR);
532
533
create_base_index(current_head);
@@ -542,6 +543,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
543
out:
544
string_list_clear(&partial, 0);
545
clear_pathspec(&pathspec);
546
+ free(path);
547
return ret;
548
}
549
builtin/gc.c
+15
-6
@@ -99,9 +99,11 @@ static void process_log_file(void)
99
/* There was some error recorded in the lock file */
100
commit_lock_file(&log_lock);
101
} else {
102
+ char *path = repo_git_path(the_repository, "gc.log");
103
/* No error, clean up any old gc.log */
103
- unlink(git_path("gc.log"));
104
+ unlink(path);
105
rollback_lock_file(&log_lock);
106
+ free(path);
107
}
108
}
109
@@ -299,8 +301,11 @@ static int too_many_loose_objects(struct gc_config *cfg)
301
int num_loose = 0;
302
int needed = 0;
303
const unsigned hexsz_loose = the_hash_algo->hexsz - 2;
304
+ char *path;
305
303
- dir = opendir(git_path("objects/17"));
306
+ path = repo_git_path(the_repository, "objects/17");
307
+ dir = opendir(path);
308
+ free(path);
309
if (!dir)
310
return 0;
311
@@ -821,11 +826,12 @@ struct repository *repo UNUSED)
826
}
827
828
if (daemonized) {
824
- hold_lock_file_for_update(&log_lock,
825
- git_path("gc.log"),
829
+ char *path = repo_git_path(the_repository, "gc.log");
830
+ hold_lock_file_for_update(&log_lock, path,
831
LOCK_DIE_ON_ERROR);
832
dup2(get_lock_file_fd(&log_lock), 2);
833
atexit(process_log_file_at_exit);
834
+ free(path);
835
}
836
837
gc_before_repack(&opts, &cfg);
@@ -887,8 +893,11 @@ struct repository *repo UNUSED)
893
warning(_("There are too many unreachable loose objects; "
894
"run 'git prune' to remove them."));
895
890
- if (!daemonized)
891
- unlink(git_path("gc.log"));
896
+ if (!daemonized) {
897
+ char *path = repo_git_path(the_repository, "gc.log");
898
+ unlink(path);
899
+ free(path);
900
+ }
901
902
out:
903
gc_config_release(&cfg);
builtin/notes.c
+6
-1
@@ -979,6 +979,8 @@ static int merge(int argc, const char **argv, const char *prefix,
979
else { /* Merge has unresolved conflicts */
980
struct worktree **worktrees;
981
const struct worktree *wt;
982
+ char *path;
983
+
984
/* Update .git/NOTES_MERGE_PARTIAL with partial merge result */
985
refs_update_ref(get_main_ref_store(the_repository), msg.buf,
986
"NOTES_MERGE_PARTIAL", &result_oid, NULL,
@@ -994,10 +996,13 @@ static int merge(int argc, const char **argv, const char *prefix,
996
if (refs_update_symref(get_main_ref_store(the_repository), "NOTES_MERGE_REF", notes_ref, NULL))
997
die(_("failed to store link to current notes ref (%s)"),
998
notes_ref);
999
+
1000
+ path = repo_git_path(the_repository, NOTES_MERGE_WORKTREE);
1001
fprintf(stderr, _("Automatic notes merge failed. Fix conflicts in %s "
1002
"and commit the result with 'git notes merge --commit', "
1003
"or abort the merge with 'git notes merge --abort'.\n"),
1000
- git_path(NOTES_MERGE_WORKTREE));
1004
+ path);
1005
+ free(path);
1006
}
1007
1008
free_notes(t);
builtin/rebase.c
+1
-1
@@ -644,7 +644,7 @@ static int run_am(struct rebase_options *opts)
644
return run_command(&am);
645
}
646
647
- rebased_patches = xstrdup(git_path("rebased-patches"));
647
+ rebased_patches = repo_git_path(the_repository, "rebased-patches");
648
format_patch.out = open(rebased_patches,
649
O_WRONLY | O_CREAT | O_TRUNC, 0666);
650
if (format_patch.out < 0) {
builtin/remote.c
+4
-2
@@ -644,9 +644,11 @@ static int migrate_file(struct remote *remote)
644
git_config_set_multivar(buf.buf, remote->fetch.items[i].raw, "^$", 0);
645
#ifndef WITH_BREAKING_CHANGES
646
if (remote->origin == REMOTE_REMOTES)
647
- unlink_or_warn(git_path("remotes/%s", remote->name));
647
+ unlink_or_warn(repo_git_path_replace(the_repository, &buf,
648
+ "remotes/%s", remote->name));
649
else if (remote->origin == REMOTE_BRANCHES)
649
- unlink_or_warn(git_path("branches/%s", remote->name));
650
+ unlink_or_warn(repo_git_path_replace(the_repository, &buf,
651
+ "branches/%s", remote->name));
652
#endif /* WITH_BREAKING_CHANGES */
653
strbuf_release(&buf);
654
builtin/rev-parse.c
+3
-3
@@ -789,8 +789,8 @@ int cmd_rev_parse(int argc,
789
if (!strcmp(arg, "--git-path")) {
790
if (!argv[i + 1])
791
die(_("--git-path requires an argument"));
792
- strbuf_reset(&buf);
793
- print_path(git_path("%s", argv[i + 1]), prefix,
792
+ print_path(repo_git_path_replace(the_repository, &buf,
793
+ "%s", argv[i + 1]), prefix,
794
format,
795
DEFAULT_RELATIVE_IF_SHARED);
796
i++;
@@ -1083,7 +1083,7 @@ int cmd_rev_parse(int argc,
1083
die(_("Could not read the index"));
1084
if (the_repository->index->split_index) {
1085
const struct object_id *oid = &the_repository->index->split_index->base_oid;
1086
- const char *path = git_path("sharedindex.%s", oid_to_hex(oid));
1086
+ const char *path = repo_git_path_replace(the_repository, &buf, "sharedindex.%s", oid_to_hex(oid));
1087
print_path(path, prefix, format, DEFAULT_RELATIVE);
1088
}
1089
continue;
builtin/worktree.c
+9
-2
@@ -163,7 +163,9 @@ static int delete_git_dir(const char *id)
163
164
static void delete_worktrees_dir_if_empty(void)
165
{
166
- rmdir(git_path("worktrees")); /* ignore failed removal */
166
+ char *path = repo_git_path(the_repository, "worktrees");
167
+ rmdir(path); /* ignore failed removal */
168
+ free(path);
169
}
170
171
static void prune_worktree(const char *id, const char *reason)
@@ -212,8 +214,13 @@ static void prune_worktrees(void)
214
struct strbuf reason = STRBUF_INIT;
215
struct strbuf main_path = STRBUF_INIT;
216
struct string_list kept = STRING_LIST_INIT_DUP;
215
- DIR *dir = opendir(git_path("worktrees"));
217
+ char *path;
218
+ DIR *dir;
219
struct dirent *d;
220
+
221
+ path = repo_git_path(the_repository, "worktrees");
222
+ dir = opendir(path);
223
+ free(path);
224
if (!dir)
225
return;
226
while ((d = readdir_skip_dot_and_dotdot(dir)) != NULL) {
notes-merge.c
+12
-8
@@ -275,34 +275,38 @@ static void diff_tree_local(struct notes_merge_options *o,
275
276
static void check_notes_merge_worktree(struct notes_merge_options *o)
277
{
278
+ struct strbuf buf = STRBUF_INIT;
279
+
280
if (!o->has_worktree) {
281
/*
282
* Must establish NOTES_MERGE_WORKTREE.
283
* Abort if NOTES_MERGE_WORKTREE already exists
284
*/
283
- if (file_exists(git_path(NOTES_MERGE_WORKTREE)) &&
284
- !is_empty_dir(git_path(NOTES_MERGE_WORKTREE))) {
285
+ if (file_exists(repo_git_path_replace(the_repository, &buf, NOTES_MERGE_WORKTREE)) &&
286
+ !is_empty_dir(repo_git_path_replace(the_repository, &buf, NOTES_MERGE_WORKTREE))) {
287
if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
288
die(_("You have not concluded your previous "
289
"notes merge (%s exists).\nPlease, use "
290
"'git notes merge --commit' or 'git notes "
291
"merge --abort' to commit/abort the "
292
"previous merge before you start a new "
291
- "notes merge."), git_path("NOTES_MERGE_*"));
293
+ "notes merge."), repo_git_path_replace(the_repository, &buf, "NOTES_MERGE_*"));
294
else
295
die(_("You have not concluded your notes merge "
294
- "(%s exists)."), git_path("NOTES_MERGE_*"));
296
+ "(%s exists)."), repo_git_path_replace(the_repository, &buf, "NOTES_MERGE_*"));
297
}
298
297
- if (safe_create_leading_directories_const(git_path(
299
+ if (safe_create_leading_directories_const(repo_git_path_replace(the_repository, &buf,
300
NOTES_MERGE_WORKTREE "/.test")))
301
die_errno("unable to create directory %s",
300
- git_path(NOTES_MERGE_WORKTREE));
302
+ repo_git_path_replace(the_repository, &buf, NOTES_MERGE_WORKTREE));
303
o->has_worktree = 1;
302
- } else if (!file_exists(git_path(NOTES_MERGE_WORKTREE)))
304
+ } else if (!file_exists(repo_git_path_replace(the_repository, &buf, NOTES_MERGE_WORKTREE)))
305
/* NOTES_MERGE_WORKTREE should already be established */
306
die("missing '%s'. This should not happen",
305
- git_path(NOTES_MERGE_WORKTREE));
307
+ repo_git_path_replace(the_repository, &buf, NOTES_MERGE_WORKTREE));
308
+
309
+ strbuf_release(&buf);
310
}
311
312
static void write_buf_to_worktree(const struct object_id *obj,
path.c
+4
-4
@@ -30,7 +30,7 @@ static int get_st_mode_bits(const char *path, int *mode)
30
return 0;
31
}
32
33
-struct strbuf *get_pathname(void)
33
+static struct strbuf *get_pathname(void)
34
{
35
static struct strbuf pathname_array[4] = {
36
STRBUF_INIT, STRBUF_INIT, STRBUF_INIT, STRBUF_INIT
@@ -417,9 +417,9 @@ static void strbuf_worktree_gitdir(struct strbuf *buf,
417
repo_common_path_append(repo, buf, "worktrees/%s", wt->id);
418
}
419
420
-void repo_git_pathv(const struct repository *repo,
421
- const struct worktree *wt, struct strbuf *buf,
422
- const char *fmt, va_list args)
420
+static void repo_git_pathv(const struct repository *repo,
421
+ const struct worktree *wt, struct strbuf *buf,
422
+ const char *fmt, va_list args)
423
{
424
int gitdir_len;
425
strbuf_worktree_gitdir(buf, repo, wt);
path.h
-27
@@ -221,37 +221,10 @@ char *xdg_cache_home(const char *filename);
221
*/
222
void safe_create_dir(const char *dir, int share);
223
224
-/*
225
- * Do not use this function. It is only exported to other subsystems until we
226
- * can get rid of the below block of functions that implicitly rely on
227
- * `the_repository`.
228
- */
229
-struct strbuf *get_pathname(void);
230
-
224
# ifdef USE_THE_REPOSITORY_VARIABLE
225
# include "strbuf.h"
226
# include "repository.h"
227
235
-/* Internal implementation details that should not be used. */
236
-void repo_git_pathv(const struct repository *repo,
237
- const struct worktree *wt, struct strbuf *buf,
238
- const char *fmt, va_list args);
239
-
240
-/*
241
- * Return a statically allocated path into the main repository's
242
- * (the_repository) git directory.
243
- */
244
-__attribute__((format (printf, 1, 2)))
245
-static inline const char *git_path(const char *fmt, ...)
246
-{
247
- struct strbuf *pathname = get_pathname();
248
- va_list args;
249
- va_start(args, fmt);
250
- repo_git_pathv(the_repository, NULL, pathname, fmt, args);
251
- va_end(args);
252
- return pathname->buf;
253
-}
254
-
228
#define GIT_PATH_FUNC(func, filename) \
229
const char *func(void) \
230
{ \
read-cache.c
+17
-7
@@ -3251,15 +3251,18 @@ static int clean_shared_index_files(const char *current_hex)
3251
3252
while ((de = readdir(dir)) != NULL) {
3253
const char *sha1_hex;
3254
- const char *shared_index_path;
3254
+ char *shared_index_path;
3255
if (!skip_prefix(de->d_name, "sharedindex.", &sha1_hex))
3256
continue;
3257
if (!strcmp(sha1_hex, current_hex))
3258
continue;
3259
- shared_index_path = git_path("%s", de->d_name);
3259
+
3260
+ shared_index_path = repo_git_path(the_repository, "%s", de->d_name);
3261
if (should_delete_shared_index(shared_index_path) > 0 &&
3262
unlink(shared_index_path))
3263
warning_errno(_("unable to unlink: %s"), shared_index_path);
3264
+
3265
+ free(shared_index_path);
3266
}
3267
closedir(dir);
3268
@@ -3271,6 +3274,7 @@ static int write_shared_index(struct index_state *istate,
3274
{
3275
struct split_index *si = istate->split_index;
3276
int ret, was_full = !istate->sparse_index;
3277
+ char *path;
3278
3279
move_cache_to_base_index(istate);
3280
convert_to_sparse(istate, 0);
@@ -3291,13 +3295,15 @@ static int write_shared_index(struct index_state *istate,
3295
error(_("cannot fix permission bits on '%s'"), get_tempfile_path(*temp));
3296
return ret;
3297
}
3294
- ret = rename_tempfile(temp,
3295
- git_path("sharedindex.%s", oid_to_hex(&si->base->oid)));
3298
+
3299
+ path = repo_git_path(the_repository, "sharedindex.%s", oid_to_hex(&si->base->oid));
3300
+ ret = rename_tempfile(temp, path);
3301
if (!ret) {
3302
oidcpy(&si->base_oid, &si->base->oid);
3303
clean_shared_index_files(oid_to_hex(&si->base->oid));
3304
}
3305
3306
+ free(path);
3307
return ret;
3308
}
3309
@@ -3378,9 +3384,12 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
3384
if (new_shared_index) {
3385
struct tempfile *temp;
3386
int saved_errno;
3387
+ char *path;
3388
3389
/* Same initial permissions as the main .git/index file */
3383
- temp = mks_tempfile_sm(git_path("sharedindex_XXXXXX"), 0, 0666);
3390
+ path = repo_git_path(the_repository, "sharedindex_XXXXXX");
3391
+ temp = mks_tempfile_sm(path, 0, 0666);
3392
+ free(path);
3393
if (!temp) {
3394
ret = do_write_locked_index(istate, lock, flags,
3395
~WRITE_SPLIT_INDEX_EXTENSION);
@@ -3401,9 +3410,10 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
3410
3411
/* Freshen the shared index only if the split-index was written */
3412
if (!ret && !new_shared_index && !is_null_oid(&si->base_oid)) {
3404
- const char *shared_index = git_path("sharedindex.%s",
3405
- oid_to_hex(&si->base_oid));
3413
+ char *shared_index = repo_git_path(the_repository, "sharedindex.%s",
3414
+ oid_to_hex(&si->base_oid));
3415
freshen_shared_index(shared_index, 1);
3416
+ free(shared_index);
3417
}
3418
3419
out:
remote.c
+12
-9
@@ -321,10 +321,11 @@ static void read_remotes_file(struct remote_state *remote_state,
321
struct remote *remote)
322
{
323
struct strbuf buf = STRBUF_INIT;
324
- FILE *f = fopen_or_warn(git_path("remotes/%s", remote->name), "r");
324
+ FILE *f = fopen_or_warn(repo_git_path_append(the_repository, &buf,
325
+ "remotes/%s", remote->name), "r");
326
327
if (!f)
327
- return;
328
+ goto out;
329
330
warn_about_deprecated_remote_type("remotes", remote);
331
@@ -343,8 +344,10 @@ static void read_remotes_file(struct remote_state *remote_state,
344
else if (skip_prefix(buf.buf, "Pull:", &v))
345
refspec_append(&remote->fetch, skip_spaces(v));
346
}
346
- strbuf_release(&buf);
347
fclose(f);
348
+
349
+out:
350
+ strbuf_release(&buf);
351
}
352
353
static void read_branches_file(struct remote_state *remote_state,
@@ -352,20 +355,19 @@ static void read_branches_file(struct remote_state *remote_state,
355
{
356
char *frag, *to_free = NULL;
357
struct strbuf buf = STRBUF_INIT;
355
- FILE *f = fopen_or_warn(git_path("branches/%s", remote->name), "r");
358
+ FILE *f = fopen_or_warn(repo_git_path_append(the_repository, &buf,
359
+ "branches/%s", remote->name), "r");
360
361
if (!f)
358
- return;
362
+ goto out;
363
364
warn_about_deprecated_remote_type("branches", remote);
365
366
strbuf_getline_lf(&buf, f);
367
fclose(f);
368
strbuf_trim(&buf);
365
- if (!buf.len) {
366
- strbuf_release(&buf);
367
- return;
368
- }
369
+ if (!buf.len)
370
+ goto out;
371
372
remote->configured_in_repo = 1;
373
remote->origin = REMOTE_BRANCHES;
@@ -393,6 +395,7 @@ static void read_branches_file(struct remote_state *remote_state,
395
refspec_appendf(&remote->push, "HEAD:refs/heads/%s", frag);
396
remote->fetch_tags = 1; /* always auto-follow */
397
398
+out:
399
strbuf_release(&buf);
400
free(to_free);
401
}
rerere.c
+11
-3
@@ -127,8 +127,12 @@ static int is_rr_file(const char *name, const char *filename, int *variant)
127
static void scan_rerere_dir(struct rerere_dir *rr_dir)
128
{
129
struct dirent *de;
130
- DIR *dir = opendir(git_path("rr-cache/%s", rr_dir->name));
130
+ char *path;
131
+ DIR *dir;
132
133
+ path = repo_git_path(the_repository, "rr-cache/%s", rr_dir->name);
134
+ dir = opendir(path);
135
+ free(path);
136
if (!dir)
137
return;
138
while ((de = readdir(dir)) != NULL) {
@@ -1234,6 +1238,7 @@ void rerere_gc(struct repository *r, struct string_list *rr)
1238
timestamp_t now = time(NULL);
1239
timestamp_t cutoff_noresolve = now - 15 * 86400;
1240
timestamp_t cutoff_resolve = now - 60 * 86400;
1241
+ struct strbuf buf = STRBUF_INIT;
1242
1243
if (setup_rerere(r, rr, 0) < 0)
1244
return;
@@ -1243,7 +1248,7 @@ void rerere_gc(struct repository *r, struct string_list *rr)
1248
repo_config_get_expiry_in_days(the_repository, "gc.rerereunresolved",
1249
&cutoff_noresolve, now);
1250
git_config(git_default_config, NULL);
1246
- dir = opendir(git_path("rr-cache"));
1251
+ dir = opendir(repo_git_path_replace(the_repository, &buf, "rr-cache"));
1252
if (!dir)
1253
die_errno(_("unable to open rr-cache directory"));
1254
/* Collect stale conflict IDs ... */
@@ -1272,9 +1277,12 @@ void rerere_gc(struct repository *r, struct string_list *rr)
1277
1278
/* ... and then remove the empty directories */
1279
for (i = 0; i < to_remove.nr; i++)
1275
- rmdir(git_path("rr-cache/%s", to_remove.items[i].string));
1280
+ rmdir(repo_git_path_replace(the_repository, &buf,
1281
+ "rr-cache/%s", to_remove.items[i].string));
1282
+
1283
string_list_clear(&to_remove, 0);
1284
rollback_lock_file(&write_lock);
1285
+ strbuf_release(&buf);
1286
}
1287
1288
/*
shallow.c
+3
-1
@@ -364,7 +364,9 @@ const char *setup_temporary_shallow(const struct oid_array *extra)
364
struct strbuf sb = STRBUF_INIT;
365
366
if (write_shallow_commits(&sb, 0, extra)) {
367
- temp = xmks_tempfile(git_path("shallow_XXXXXX"));
367
+ char *path = repo_git_path(the_repository, "shallow_XXXXXX");
368
+ temp = xmks_tempfile(path);
369
+ free(path);
370
371
if (write_in_full(temp->fd, sb.buf, sb.len) < 0 ||
372
close_tempfile_gently(temp) < 0)
wt-status.c
+26
-16
@@ -1289,7 +1289,8 @@ static void show_am_in_progress(struct wt_status *s,
1289
static char *read_line_from_git_path(const char *filename)
1290
{
1291
struct strbuf buf = STRBUF_INIT;
1292
- FILE *fp = fopen_or_warn(git_path("%s", filename), "r");
1292
+ FILE *fp = fopen_or_warn(repo_git_path_append(the_repository, &buf,
1293
+ "%s", filename), "r");
1294
1295
if (!fp) {
1296
strbuf_release(&buf);
@@ -1383,27 +1384,33 @@ static void abbrev_oid_in_line(struct strbuf *line)
1384
1385
static int read_rebase_todolist(const char *fname, struct string_list *lines)
1386
{
1386
- struct strbuf line = STRBUF_INIT;
1387
- FILE *f = fopen(git_path("%s", fname), "r");
1387
+ struct strbuf buf = STRBUF_INIT;
1388
+ FILE *f = fopen(repo_git_path_append(the_repository, &buf, "%s", fname), "r");
1389
+ int ret;
1390
1391
if (!f) {
1390
- if (errno == ENOENT)
1391
- return -1;
1392
+ if (errno == ENOENT) {
1393
+ ret = -1;
1394
+ goto out;
1395
+ }
1396
die_errno("Could not open file %s for reading",
1393
- git_path("%s", fname));
1397
+ repo_git_path_replace(the_repository, &buf, "%s", fname));
1398
}
1395
- while (!strbuf_getline_lf(&line, f)) {
1396
- if (starts_with(line.buf, comment_line_str))
1399
+ while (!strbuf_getline_lf(&buf, f)) {
1400
+ if (starts_with(buf.buf, comment_line_str))
1401
continue;
1398
- strbuf_trim(&line);
1399
- if (!line.len)
1402
+ strbuf_trim(&buf);
1403
+ if (!buf.len)
1404
continue;
1401
- abbrev_oid_in_line(&line);
1402
- string_list_append(lines, line.buf);
1405
+ abbrev_oid_in_line(&buf);
1406
+ string_list_append(lines, buf.buf);
1407
}
1408
fclose(f);
1405
- strbuf_release(&line);
1406
- return 0;
1409
+
1410
+ ret = 0;
1411
+out:
1412
+ strbuf_release(&buf);
1413
+ return ret;
1414
}
1415
1416
static void show_rebase_information(struct wt_status *s,
@@ -1434,9 +1441,12 @@ static void show_rebase_information(struct wt_status *s,
1441
i < have_done.nr;
1442
i++)
1443
status_printf_ln(s, color, " %s", have_done.items[i].string);
1437
- if (have_done.nr > nr_lines_to_show && s->hints)
1444
+ if (have_done.nr > nr_lines_to_show && s->hints) {
1445
+ char *path = repo_git_path(the_repository, "rebase-merge/done");
1446
status_printf_ln(s, color,
1439
- _(" (see more in file %s)"), git_path("rebase-merge/done"));
1447
+ _(" (see more in file %s)"), path);
1448
+ free(path);
1449
+ }
1450
}
1451
1452
if (yet_to_do.nr == 0)