diff options
author | Ori Bernstein <ori@eigenstate.org> | 2021-05-30 17:46:21 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2021-05-30 17:46:21 -0700 |
commit | 12e952e684d149628360b6fcdb583be86052f944 (patch) | |
tree | b7ede146e2d145c9dcdc92a80e1a92d2be869aad /sys/src/cmd/git/query.c | |
parent | 1af2546e96fa96ec5341026dd509c9e4ed54c6db (diff) |
git/fs: move mount point to $repo/.git/fs
Moving the mount point to within the repo
directory means that we can have multiple
git repos mounted at once with no conflict.
Diffstat (limited to 'sys/src/cmd/git/query.c')
-rw-r--r-- | sys/src/cmd/git/query.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/src/cmd/git/query.c b/sys/src/cmd/git/query.c index 5f1330dad..cb0f243df 100644 --- a/sys/src/cmd/git/query.c +++ b/sys/src/cmd/git/query.c @@ -154,7 +154,7 @@ main(int argc, char **argv) { int i, j, n; Hash *h; - char *p, *e, *s; + char *p, *e, *s, *objpfx; char query[2048], repo[512]; ARGBEGIN{ @@ -173,6 +173,8 @@ main(int argc, char **argv) sysfatal("find root: %r"); if(chdir(repo) == -1) sysfatal("chdir: %r"); + if((objpfx = smprint("%s/.git/fs/object/", repo)) == nil) + sysfatal("smprint: %r"); s = ""; p = query; e = query + nelem(query); @@ -187,7 +189,7 @@ main(int argc, char **argv) sysfatal("diff: need 2 commits, got %d", n); diffcommits(h[0], h[1]); }else{ - p = (fullpath ? "/mnt/git/object/" : ""); + p = (fullpath ? objpfx : ""); for(j = 0; j < n; j++) print("%s%H\n", p, h[reverse ? n - 1 - j : j]); } |