Commit db66df38 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Limit to one file *added*

parent f10c72d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ prebuild_lab_2:
  script:
    - echo "Changes Detected (if any):";
    - git diff --name-only $CI_COMMIT_SHA~ $CI_COMMIT_SHA || echo "No changes found";
    - FILES_ADDED=$(git diff --name-only --diff-filter=A HEAD~1 | wc -l)
    - |
      # Check if lab2.cpp exists
      if [ ! -f "lab2.cpp" ]; then
@@ -12,7 +13,6 @@ prebuild_lab_2:
      fi
      
      # Check that only one file was checked in
      FILES_ADDED=$(git diff --name-only --diff-filter=A HEAD~1 | wc -l)
      if [ "FILES_ADDED" -ne 1 ]; then
        echo "Error: Only one file should be committed.";
        exit 1;