Skip to content

Commit

Permalink
git-am: head -1 is obsolete and doesn't work on some new systems
Browse files Browse the repository at this point in the history
head -<n> was deprecated by POSIX, and as modern versions of coreutils
package don't support it at least one exports _POSIX2_VERSION=199209
it's fails on some systems.

head -n<n> is portable, but sed <n>q is even more.

Signed-off-by: Alejandro Mery <amery@geeks.cl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Alejandro Mery authored and Junio C Hamano committed Jun 17, 2008
1 parent 1a8fb15 commit 1d9b265
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ do
else
action=yes
fi
FIRSTLINE=$(head -1 "$dotest/final-commit")
FIRSTLINE=$(sed 1q "$dotest/final-commit")

if test $action = skip
then
Expand Down

0 comments on commit 1d9b265

Please sign in to comment.