chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
playground refactor: Dgit.pm: fresh_playground: Improve error message
[dgit.git]
/
Debian
/
Dgit.pm
diff --git
a/Debian/Dgit.pm
b/Debian/Dgit.pm
index b678ba53ead7cba05a4d579ebef5ae1f5f5df6c9..c4a61af1f081b62f21938ac86783a0deef000286 100644
(file)
--- a/
Debian/Dgit.pm
+++ b/
Debian/Dgit.pm
@@
-543,7
+543,7
@@
our $playground;
sub ensure_a_playground_parent ($) {
my ($spc) = @_;
record_maindir();
sub ensure_a_playground_parent ($) {
my ($spc) = @_;
record_maindir();
- $spc = "
.git
/$spc";
+ $spc = "
$maindir_gitdir
/$spc";
my $parent = dirname $spc;
mkdir $parent or $!==EEXIST
or fail "failed to mkdir playground parent $parent: $!";
my $parent = dirname $spc;
mkdir $parent or $!==EEXIST
or fail "failed to mkdir playground parent $parent: $!";
@@
-561,8
+561,8
@@
sub fresh_playground ($) {
my ($spc) = @_;
$spc = ensure_a_playground_parent $spc;
rmtree $spc;
my ($spc) = @_;
$spc = ensure_a_playground_parent $spc;
rmtree $spc;
- mkdir $spc or
die "$spc
$!";
- return $playground =
"$maindir/$spc"
;
+ mkdir $spc or
fail "failed to mkdir the playground $spc:
$!";
+ return $playground =
$spc
;
}
# ----- playtrees -----
}
# ----- playtrees -----
@@
-582,8
+582,13
@@
sub playtree_setup (;$) {
next unless $v;
runcmd qw(git config), $copy, $_ foreach @$v;
}
next unless $v;
runcmd qw(git config), $copy, $_ foreach @$v;
}
+ # this is confusing: we have
+ # . playtree, not a worktree, has .git/, our cwd
+ # $maindir might be a worktree so
+ # $maindir_gitdir contains our main working "dgit", HEAD, etc.
+ # $maindir_gitcommon the shared stuff, including .objects
rmtree('.git/objects');
rmtree('.git/objects');
- symlink "$maindir
/.git
/objects",'.git/objects' or die $!;
+ symlink "$maindir
_gitcommon
/objects",'.git/objects' or die $!;
ensuredir '.git/info';
open GA, "> .git/info/attributes" or die $!;
print GA "* $negate_harmful_gitattrs\n" or die $!;
ensuredir '.git/info';
open GA, "> .git/info/attributes" or die $!;
print GA "* $negate_harmful_gitattrs\n" or die $!;