Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions GVFS/GVFS/CommandLine/DehydrateVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected override void Execute(GVFSEnlistment enlistment)
if (!this.Confirmed && fullDehydrate)
{
this.Output.WriteLine(
@"WARNING: THIS IS AN EXPERIMENTAL FEATURE
$@"WARNING: THIS IS AN EXPERIMENTAL FEATURE

Dehydrate will back up your src folder, and then create a new, empty src folder
with a fresh virtualization of the repo. All of your downloaded objects, branches,
Expand All @@ -130,8 +130,7 @@ any of your uncommitted changes.
in the backup folder, but it will be harder to find them because 'git status'
will not work in the backup.

To actually execute the dehydrate, run 'gvfs dehydrate --confirm' from the parent
of your enlistment's src folder.
To actually execute the dehydrate, run 'gvfs dehydrate --confirm' from {enlistment.EnlistmentRoot}.
");

return;
Expand All @@ -155,6 +154,13 @@ from a parent of the folders list.
return;
}

if (fullDehydrate && Environment.CurrentDirectory.StartsWith(enlistment.WorkingDirectoryBackingRoot))
{
/* If running from /src, the dehydrate would fail because of the handle we are holding on it. */
this.Output.WriteLine($"Dehydrate must be run from {enlistment.EnlistmentRoot}");
return;
}

if (this.NoStatus && !fullDehydrate)
{
this.ReportErrorAndExit(tracer, "Dehydrate --no-status not valid with --folders");
Expand Down
Loading