Skip to content

Commit

Permalink
show tag-filter difference
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll committed Oct 31, 2024
1 parent 274545d commit 3768655
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/gt-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,16 @@ function gt_pull() {
currentLocation=$(realpath --relative-to="$currentDir" "$workingDirAbsolute/$entryRelativePath" || echo "$workingDirAbsolute/$entryRelativePath")
newLocation=$(realpath --relative-to="$currentDir" "$pullDir/$targetFile" || echo "$pullDir/$targetFile")
local -r currentLocation newLocation
logWarning "the file was previously pulled to a different location"
echo "current location: $currentLocation"
echo " new location: $newLocation"
printf "Won't pull the file again, you have several alternatives:\n- remove the entry from %s and pull it again\n- move the file manually and adjust the relativeTarget of the entry (and pull again)\n" "$pulledTsv"
if [[ "$currentLocation" != "$newLocation" ]]; then
logWarning "the file was previously pulled to a different location"
echo "current location: $currentLocation"
echo " new location: $newLocation"
printf "Won't pull the file again, you have several alternatives:\n- remove the entry from %s and pull it again\n- move the file manually and adjust the relativeTarget of the entry (and pull again)\n" "$pulledTsv"
else
logWarning "the file was pulled previously but with a different tag-filter (see difference between new and old entry):"
gitDiffChars "$currentEntry" "$entry"
printf "Won't pull the file again, remove the entry from %s and \`gt pull\` if you want to pull it nonetheless\n" "$pulledTsv"
fi
rm "$source"
return
elif [[ -f $absoluteTarget ]]; then
Expand Down

0 comments on commit 3768655

Please sign in to comment.