xo-umbrella2/patches/git-subtree-cache-fix.patch
Roland Conybeare 6c7a6c5e4a refactor nix: consolidate xo deps
default.nix now uses xo.nix for each xo dep
2026-05-25 12:11:36 -04:00

18 lines
433 B
Diff

--- a/git-subtree
+++ b/git-subtree
@@ -341,7 +341,13 @@ cache_set () {
if test "$oldrev" != "latest_old" &&
test "$oldrev" != "latest_new" &&
test -e "$cachedir/$oldrev"
then
- die "fatal: cache for $oldrev already exists!"
+ existing=$(cat "$cachedir/$oldrev")
+ if test "$existing" = "$newrev"
+ then
+ return
+ else
+ die "fatal: cache for $oldrev already exists!"
+ fi
fi
echo "$newrev" >"$cachedir/$oldrev"
}