summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-09-14 08:52:39 +0200
committerGuido Günther <agx@sigxcpu.org>2010-09-14 08:53:47 +0200
commitaf977814839275395f9c747b32611da712cf443d (patch)
treeb1c0eafe0f22f696d5f225a12d136490467c8be7
parent257a3e1f5aae069079db174ffa23c832643a485d (diff)
Avoid unnecessary branch switch
when fixing the previous issues. LP: #637286
-rwxr-xr-xgit-import-dsc5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-import-dsc b/git-import-dsc
index 06747d5e..1a5d10b9 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."