diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2026-04-05 08:59:35 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2026-04-05 08:59:35 +0800 |
| commit | 2ca21847adfbc38e83738010f44c854e45e590d5 (patch) | |
| tree | d33be25587f5ad0931e8bba73194107e99ee177e | |
| parent | 5d2ea0e0b78a1a2e539289f9085df171675c7a01 (diff) | |
| download | cvn-2ca21847adfbc38e83738010f44c854e45e590d5.tar.gz | |
Eliminate dead code.
| -rw-r--r-- | vcx | 35 |
1 files changed, 2 insertions, 33 deletions
@@ -75,8 +75,9 @@ sub run_status { print "On revision [$head]\n"; my %staged_diffs; + my $staged_diff_bundle = TMP_DIFF; if (-e TMP_DIFF) { - my @list = qx(tar -tf TMP_DIFF); + my @list = qx(tar -tf '$staged_diff_bundle'); foreach (@list) { chomp; if (/(.+)\.patch$/) { $staged_diffs{$1} = 1; } @@ -371,38 +372,6 @@ sub stage_link { print "[Staged link] $src -> $target\n"; } -sub stage_deletions { - my ($target) = @_; - - open my $fh, '<', HEAD or die "Not a repository.\n"; - my $head = <$fh>; chomp $head; close $fh; - my $latest_tree = File::Spec->catfile(REV_DIR, $head, "tree"); - - my $search = ($target eq '.') ? $latest_tree : File::Spec->catfile($latest_tree, $target); - return unless -d $search || -e $search; - - find({ - wanted => sub { - return if -d $_; # Skip directories - - # '$_' is the file inside the commit tree - # '$rel' is its path relative to the commit root - my $rel = File::Spec->abs2rel($_, $latest_tree); - - # File exists in history but is gone from the workspace - if (!-e $rel) { - # If we have a staged link/file, remove it. - my $tmp_link = File::Spec->catfile(TMP_DIR, $rel); - if (-l $tmp_link || -e $tmp_link) { - unlink($tmp_link); - print "Staged deletion: $rel\n"; - } - } - }, - no_chdir => 1 - }, $search); -} - sub make_patch { my ($src, $obj_name, $obj_path, $patches) = @_; |
