From 614b9d8244ee896684b0b3037fe3e42245ea5644 Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Mon, 16 Jan 2023 02:56:00 -0800 Subject: [PATCH] Revert "Handle importing files which are not yet tracked by git" This reverts commit 1e5a0015a312a33c264a2e93506716ae40b96592. --- hledger-import-new-xact.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hledger-import-new-xact.sh b/hledger-import-new-xact.sh index de2e0a1..6a08363 100755 --- a/hledger-import-new-xact.sh +++ b/hledger-import-new-xact.sh @@ -6,7 +6,6 @@ RULES="$3" CSV_LENGTH_OFFSET="${4:-0}" # Number of lines in the CSV before/after data CSV_BASENAME="${CSV##*/}" -CSV_DIRNAME="$(dirname $CSV)" TMP_DIR="${HOME}/.tmp" TMP_CSV="$TMP_DIR/$CSV_BASENAME" @@ -24,14 +23,6 @@ duplicates_p () { test ! $(("$JOURNAL_LENGTH" + "$LINES_ADDED_LENGTH" + "$CSV_LE # Body -# If csv is a new file, not yet tracked by git, import the whole file. -if ! $(git cat-file -e HEAD:$CSV 2> /dev/null); then - echo -e "$CSV not tracked by git; importing all transactions.\n\n" - hledger import -f "$JOURNAL" --rules-file="$RULES" "$CSV" - rm -f "$CSV_DIRNAME/.latest.$CSV_BASENAME" # Clean up any .latest files - exit 0 -fi - # For some reason, hledger import would not import entries from a CSV stored inside /tmp/ on my Debian 11 machine. # Instead of using a tmp file, it might be preferable if hledger import accepted input from stdin. mkdir -p "$TMP_DIR" -- 2.45.2