A ref might be pointing to another ref but only the name of the last ref
is remembered. Let's remember about the first name as well.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
lock->lk = xcalloc(1, sizeof(struct lock_file));
lock->ref_name = xstrdup(ref);
+ lock->orig_ref_name = xstrdup(orig_ref);
ref_file = git_path("%s", ref);
lock->force_write = lstat(ref_file, &st) && errno == ENOENT;
rollback_lock_file(lock->lk);
}
free(lock->ref_name);
+ free(lock->orig_ref_name);
free(lock);
}
struct ref_lock {
char *ref_name;
+ char *orig_ref_name;
struct lock_file *lk;
unsigned char old_sha1[20];
int lock_fd;