diff -Nru git-extras-1.9.1/debian/changelog git-extras-1.9.1/debian/changelog --- git-extras-1.9.1/debian/changelog 2014-09-01 13:07:21.000000000 -0400 +++ git-extras-1.9.1/debian/changelog 2015-03-09 23:02:28.000000000 -0400 @@ -1,3 +1,12 @@ +git-extras (1.9.1-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * git-fresh-branch: Check for changes and prompt for input + before deleting untracked changes. Backported from + upstream (Closes: #779784). + + -- Andrew Starr-Bochicchio Mon, 09 Mar 2015 23:00:33 -0400 + git-extras (1.9.1-1) unstable; urgency=low * New upstream release. diff -Nru git-extras-1.9.1/debian/patches/fresh-branch_check_for_changes.patch git-extras-1.9.1/debian/patches/fresh-branch_check_for_changes.patch --- git-extras-1.9.1/debian/patches/fresh-branch_check_for_changes.patch 1969-12-31 19:00:00.000000000 -0500 +++ git-extras-1.9.1/debian/patches/fresh-branch_check_for_changes.patch 2015-03-09 23:00:20.000000000 -0400 @@ -0,0 +1,41 @@ +From 28df09b10323817bb7ffecfc9c819841a73b2b5e Mon Sep 17 00:00:00 2001 +From: Andrew Starr-Bochicchio +Date: Mon, 9 Mar 2015 22:14:05 -0400 +Subject: [PATCH] git-fresh-branch: Check for changes and prompt for input + before nuking. (Issue: #142) +Bug: https://github.com/tj/git-extras/issues/142 +Debian-Bug: https://bugs.debian.org/779784 + +--- + bin/git-fresh-branch | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) + +Index: git-extras-1.9.1/bin/git-fresh-branch +=================================================================== +--- git-extras-1.9.1.orig/bin/git-fresh-branch 2015-03-09 23:00:17.250064814 -0400 ++++ git-extras-1.9.1/bin/git-fresh-branch 2015-03-09 23:00:17.246064752 -0400 +@@ -4,6 +4,21 @@ + + test -z $branch && echo "branch required." 1>&2 && exit 1 + +-git symbolic-ref HEAD refs/heads/$branch +-rm .git/index +-git clean -fdx ++changes=`git status --porcelain` ++ ++clean() ++{ ++ git symbolic-ref HEAD refs/heads/$branch ++ rm .git/index ++ git clean -fdx ++} ++ ++if [ ! -z "$changes" ]; then ++ read -p "All untracked changes will be lost. Continue [y/N]? " res ++ case $res in ++ [Yy]* ) clean; break;; ++ * ) exit 0;; ++ esac ++fi ++ ++clean diff -Nru git-extras-1.9.1/debian/patches/series git-extras-1.9.1/debian/patches/series --- git-extras-1.9.1/debian/patches/series 2014-09-01 13:18:25.000000000 -0400 +++ git-extras-1.9.1/debian/patches/series 2015-03-09 22:58:17.000000000 -0400 @@ -3,3 +3,4 @@ remove_utf-8_from_manpages.patch escape_line_dot_start.patch make_git-obliterate_shell_script.patch +fresh-branch_check_for_changes.patch