From af977814839275395f9c747b32611da712cf443d Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 14 Sep 2010 08:52:39 +0200 Subject: Avoid unnecessary branch switch when fixing the previous issues. LP: #637286 --- git-import-dsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/git-import-dsc b/git-import-dsc index 06747d5..1a5d10b 100755 --- a/git-import-dsc +++ b/git-import-dsc @@ -261,8 +261,9 @@ def main(argv): apply_debian_patch(repo, unpack_dir, src, options, parents) else: print >>sys.stderr, "Warning: Didn't find a diff to apply." - repo.set_branch(options.debian_branch) - repo.force_head(options.debian_branch, hard=True) + if repo.get_branch() == options.debian_branch: + # Update HEAD if we modified the checkout out branch + repo.force_head(options.debian_branch, hard=True) except KeyboardInterrupt: ret = 1 print >>sys.stderr, "Interrupted. Aborting." -- cgit v1.2.3