From 54392780c385cca39fb4b82c5e61599c9c5cd49e Mon Sep 17 00:00:00 2001 From: David Celis Date: Fri, 30 Apr 2021 14:44:13 -0700 Subject: [PATCH] Allow git-sync to delete squashed branches --- local/bin/git-sync | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/local/bin/git-sync b/local/bin/git-sync index 3d067d2..7493c97 100755 --- a/local/bin/git-sync +++ b/local/bin/git-sync @@ -75,7 +75,9 @@ upstream_branch() { } is_ancestor() { - git merge-base --is-ancestor "$@" + git merge-base --is-ancestor "$@" || ( + merge_base=$(git merge-base "$@") && [[ $(git cherry $2 $(git commit-tree $(git rev-parse $1^{tree}) -p $merge_base -m _)) == "-"* ]] + ) } git fetch "$ORIGIN" --prune --quiet --progress -- 2.51.2