Skip to contentSkip to conversation

cvsserver: Handle re-added files correctly

PATCH New Frank Lichtenheld 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cvsserver: Handle re-added files correctly

We can't unconditionally assign revision 1.1 to newly added files. In case the file did exist in the past and was deleted we need to honor the old revision number.

---
 git-cvsserver.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Found due to working on the test cases.

git-cvsserver.perl +1 -1
index 087e3ab..3e7bf5b 100755
@@ -2519,7 +2519,7 @@ sub update
                     #$log->debug("ADDED    $name");
                     $head->{$name} = {
                         name => $name,
-                        revision => 1,
+                        revision => $head->{$name}{revision} ? $head->{$name}{revision}+1 : 1,
                         filehash => $hash,
                         commithash => $commit->{hash},
                         modified => $commit->{date},
Signature · 1 line
1.5.1.2