summaryrefslogtreecommitdiff
path: root/src/ostree/ot-builtin-pull-local.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2015-02-13 11:39:02 -0500
committerColin Walters <walters@verbum.org>2015-02-13 11:39:36 -0500
commit64363c26acfcc2e029dae138810310d3d6d8117e (patch)
treecf1e254c563fa426b45de37bf3ecd552e86fafbe /src/ostree/ot-builtin-pull-local.c
parent9cc98041953090160dde48afa69b97c936541cdb (diff)
downloadostree-64363c26acfcc2e029dae138810310d3d6d8117e.tar.gz
pull-local: Fix regression with absolute paths
Don't add cwd unless the path is relative.
Diffstat (limited to 'src/ostree/ot-builtin-pull-local.c')
-rw-r--r--src/ostree/ot-builtin-pull-local.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c
index acad43bc..4588ccb0 100644
--- a/src/ostree/ot-builtin-pull-local.c
+++ b/src/ostree/ot-builtin-pull-local.c
@@ -70,9 +70,13 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr
src_repo_arg = argv[1];
- { gs_free char *cwd = g_get_current_dir ();
- src_repo_uri = g_strconcat ("file://", cwd, "/", src_repo_arg, NULL);
- }
+ if (src_repo_arg[0] == '/')
+ src_repo_uri = g_strconcat ("file://", src_repo_arg, NULL);
+ else
+ {
+ gs_free char *cwd = g_get_current_dir ();
+ src_repo_uri = g_strconcat ("file://", cwd, "/", src_repo_arg, NULL);
+ }
if (opt_disable_fsync)
ostree_repo_set_disable_fsync (repo, TRUE);