summaryrefslogtreecommitdiffstats
path: root/vcx
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2026-04-05 07:36:12 +0800
committerSadeep Madurange <sadeep@asciimx.com>2026-04-05 07:36:12 +0800
commit152a9e9a03d8c5ead25e9a0ecfe46aa527bf0257 (patch)
tree348c6343a087f6401d086af9d7fd0c1416cf699d /vcx
parent158e40b8c2b89114ebc3b8c83266cc17ff67f614 (diff)
downloadcvn-152a9e9a03d8c5ead25e9a0ecfe46aa527bf0257.tar.gz
Snapshot first and last.
Diffstat (limited to 'vcx')
-rw-r--r--vcx13
1 files changed, 5 insertions, 8 deletions
diff --git a/vcx b/vcx
index cf8b4bc..cbe5620 100644
--- a/vcx
+++ b/vcx
@@ -22,7 +22,7 @@ use constant REV_DIR => VCX_DIR . '/rev'; # Commits
use constant TMP_DIR => VCX_DIR . '/index';
use constant TMP_TREE => TMP_DIR . '/tree';
use constant TMP_DIFF => TMP_DIR . '/deltas';
-use constant TMP_META_FILE => TMP_DIR . '/meta';
+use constant TMP_META => TMP_DIR . '/meta';
Getopt::Long::Configure("bundling");
@@ -160,7 +160,7 @@ sub run_add {
my $next_id_hex = to_hex_id(from_hex_id($head) + 1);
my %entries;
- open my $afh, '>>', TMP_META_FILE or die $!;
+ open my $afh, '>>', TMP_META or die $!;
init_stage($latest_tree_dir, \%entries);
@@ -202,15 +202,12 @@ sub run_add {
# CASE 2: Symlink
elsif (-l _) {
my $target = readlink($File::Find::name);
-
if (-l $prev_link) {
return if readlink($prev_link) eq $target;
}
-
if (-l $staged_path) {
return if readlink($staged_path) eq $target;
}
-
stage_link($File::Find::name, $staged_path);
}
},
@@ -251,7 +248,7 @@ sub run_add {
sub run_commit {
my ($msg) = @_;
- my $content_changed = -s TMP_META_FILE;
+ my $content_changed = -s TMP_META;
my ($staged_tree_ptr) = bsd_glob(File::Spec->catfile(TMP_DIR, "tree-*"));
my ($tree_hash) = $staged_tree_ptr =~ /tree-([a-f0-9]{40})$/;
@@ -277,8 +274,8 @@ sub run_commit {
make_path($rev_dir);
# Save file to store
- if (-e TMP_META_FILE) {
- open my $mfh, '<', TMP_META_FILE or die $!;
+ if (-e TMP_META) {
+ open my $mfh, '<', TMP_META or die $!;
while (my $rel = <$mfh>) {
chomp $rel;
my $obj_name = sha1_hex($rel);