summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-debpush8
-rw-r--r--git-debpush.1.pod6
2 files changed, 14 insertions, 0 deletions
diff --git a/git-debpush b/git-debpush
index 402b1dd..c3b067d 100755
--- a/git-debpush
+++ b/git-debpush
@@ -230,6 +230,14 @@ case "$quilt_mode" in
*) badusage "invalid quilt mode: $quilt_mode" ;;
esac
+# **** Early sanity check ****
+
+if [ "$branch" = "HEAD" ] \
+ && ! git symbolic-ref --quiet HEAD >/dev/null; then
+ fail_check detached \
+ "HEAD is detached; you probably don't want to debpush it"
+fi
+
# **** Gather git information ****
remoteconfigs=()
diff --git a/git-debpush.1.pod b/git-debpush.1.pod
index b9a908e..5e40e3c 100644
--- a/git-debpush.1.pod
+++ b/git-debpush.1.pod
@@ -243,6 +243,12 @@ git-debrebase(1) branch in an unstitched state (see git-debrebase(5)).
=back
+=item B<detached>
+
+Ignore the fact that HEAD is to be tagged, but HEAD is detached (this
+check is only run when B<--branch=HEAD> or no B<--branch> option is
+specified).
+
=back
=head1 SEE ALSO