Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

git-archive-and-format-patch: Don't zip patches if there's only one

  • Loading branch information...
commit 1865c0df340344810e1b48dc9122b741b0adc533 1 parent 7dfce7f
@MaxNanasy authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 git-archive-and-format-patch
View
6 git-archive-and-format-patch
@@ -22,5 +22,9 @@ git diff --quiet --diff-filter=AM "$merge_base" "$end_commit" ||
xargs -0 git archive -o archive-and-format-patch/modified-and-new-files.zip "$end_commit" --
git format-patch --quiet -o archive-and-format-patch/patches "$start_commit..$end_commit"
-zip -qj archive-and-format-patch/patches{.zip,/*.patch}
+if [ "$(ls archive-and-format-patch/patches | wc -l)" -gt 1 ]; then
+ zip -qj archive-and-format-patch/patches{.zip,/*.patch}
+else
+ cp archive-and-format-patch/{patches/*.patch,}
+fi
rm -r archive-and-format-patch/patches

0 comments on commit 1865c0d

Please sign in to comment.
Something went wrong with that request. Please try again.