Code

Merge branch 'tr/doc-sh-setup'
authorJunio C Hamano <gitster@pobox.com>
Thu, 22 Dec 2011 23:30:29 +0000 (15:30 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Dec 2011 23:30:29 +0000 (15:30 -0800)
* tr/doc-sh-setup:
  git-sh-setup: make require_clean_work_tree part of the interface

Documentation/git-sh-setup.txt

index a2f346ca710e03a7f5c65574659ac578ab8bf615..5e5f1c89646cf4389bfd30ba8e90eb0552e80aab 100644 (file)
@@ -68,6 +68,16 @@ require_work_tree_exists::
        cd_to_toplevel, which is impossible to do if there is no
        working tree.
 
+require_clean_work_tree <action> [<hint>]::
+       checks that the working tree and index associated with the
+       repository have no uncommitted changes to tracked files.
+       Otherwise it emits an error message of the form `Cannot
+       <action>: <reason>. <hint>`, and dies.  Example:
++
+----------------
+require_clean_work_tree rebase "Please commit or stash them."
+----------------
+
 get_author_ident_from_commit::
        outputs code for use with eval to set the GIT_AUTHOR_NAME,
        GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE variables for a given commit.