commit - 797bc7b9c23dea7041e152b5fe410c0c762eb416
commit + 23721109e309187ba1da65d068dc11ccf30fe835
blob - 398bd39abcf67f6c7ff362b0deb47a88374598e0
blob + d390e0e9923fdb62cd4a0ef9bd47b0c99499fa7e
--- got/got.c
+++ got/got.c
goto done;
}
- error = got_repo_map_path(&in_repo_path, repo, path);
+ error = got_repo_map_path(&in_repo_path, repo, path, 1);
if (error != NULL)
goto done;
if (in_repo_path) {
if (error != NULL)
goto done;
- error = got_repo_map_path(&in_repo_path, repo, path);
+ error = got_repo_map_path(&in_repo_path, repo, path, 1);
if (error != NULL)
goto done;
if (error != NULL)
goto done;
- error = got_repo_map_path(&in_repo_path, repo, path);
+ error = got_repo_map_path(&in_repo_path, repo, path, 1);
if (error != NULL)
goto done;
blob - 2fd4ddd312ea5fb19ea1ae92f79f49a045bb517b
blob + 37f50bb121ab922394e63c883653fa25db30d824
--- include/got_repository.h
+++ include/got_repository.h
/* Attempt to map an arbitrary path to a path within the repository. */
const struct got_error *got_repo_map_path(char **, struct got_repository *,
- const char *);
+ const char *, int);
blob - d45495d120dd2536e096a1bb2020674dd2569731
blob + d82e38e345a904ababe7f97b02142d026947c304
--- lib/repository.c
+++ lib/repository.c
const struct got_error *
got_repo_map_path(char **in_repo_path, struct got_repository *repo,
- const char *input_path)
+ const char *input_path, int check_disk)
{
const struct got_error *err = NULL;
char *repo_abspath = NULL, *cwd = NULL;
struct stat sb;
size_t repolen, cwdlen, len;
- char *canonpath, *path;
+ char *canonpath, *path = NULL;
*in_repo_path = NULL;
/* TODO: Call "get in-repository path of work-tree node" API. */
- if (lstat(canonpath, &sb) != 0) {
+ if (!check_disk)
+ path = strdup(canonpath);
+ else if (lstat(canonpath, &sb) != 0) {
if (errno != ENOENT) {
err = got_error_from_errno();
goto done;
blob - 220eb8ceb0493512a82f2c08d172311605f37f14
blob + c90730d590e4ba7275acd95c527f87e190991447
--- tog/tog.c
+++ tog/tog.c
static const struct got_error* close_diff_view(struct tog_view *);
static const struct got_error *open_log_view(struct tog_view *,
- struct got_object_id *, struct got_repository *, const char *);
+ struct got_object_id *, struct got_repository *, const char *, int);
static const struct got_error * show_log_view(struct tog_view *);
static const struct got_error *input_log_view(struct tog_view **,
struct tog_view **, struct tog_view **, struct tog_view *, int);
static const struct got_error *
open_log_view(struct tog_view *view, struct got_object_id *start_id,
- struct got_repository *repo, const char *path)
+ struct got_repository *repo, const char *path, int check_disk)
{
const struct got_error *err = NULL;
struct tog_log_view_state *s = &view->state.log;
struct got_commit_graph *thread_graph = NULL;
int errcode;
- err = got_repo_map_path(&s->in_repo_path, repo, path);
+ err = got_repo_map_path(&s->in_repo_path, repo, path, check_disk);
if (err != NULL)
goto done;
if (lv == NULL)
return got_error_from_errno();
err = open_log_view(lv, s->start_id, s->repo,
- parent_path);
+ parent_path, 0);
if (err)
return err;;
if (view_is_parent_view(view))
error = got_error_from_errno();
goto done;
}
- error = open_log_view(view, start_id, repo, path);
+ error = open_log_view(view, start_id, repo, path, 1);
if (error)
goto done;
error = view_loop(view);
if (error != NULL)
return error;
- error = got_repo_map_path(&in_repo_path, repo, path);
+ error = got_repo_map_path(&in_repo_path, repo, path, 1);
if (error != NULL)
goto done;
if (err)
return err;
- err = open_log_view(log_view, commit_id, repo, path);
+ err = open_log_view(log_view, commit_id, repo, path, 0);
if (err)
view_close(log_view);
else