From: Catalin Marinas Date: Wed, 3 Aug 2005 11:20:42 +0000 (+0100) Subject: Save .git/ORIG_HEAD when pulling changes X-Git-Tag: v0.14.3~721 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/5b0f1eaa09175829268a684eb4ba64a53db8f762?ds=sidebyside Save .git/ORIG_HEAD when pulling changes ORIG_HEAD is the base of the stack before merging the latest remote changes. Signed-off-by: Catalin Marinas --- diff --git a/stgit/commands/pull.py b/stgit/commands/pull.py index ab7466e..4a82fe8 100644 --- a/stgit/commands/pull.py +++ b/stgit/commands/pull.py @@ -59,14 +59,17 @@ def func(parser, options, args): branch = git.get_head_file() location = read_string(os.path.join(git.base_dir, 'branches', branch)) + orig_head = git_id('base') print 'Pulling from "%s"...' % location new_head = git.fetch(location, options.head, options.tag) print 'done' - if new_head == git_id('base'): + if new_head == orig_head: print 'Branch already up-to-date' else: + write_string(os.path.join(git.base_dir, 'ORIG_HEAD'), orig_head) + applied = crt_series.get_applied() if len(applied) > 0: