chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
682d668
)
fix is_fast_fwd (rename and introduce rev parse)
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Wed, 14 Aug 2013 18:22:14 +0000
(19:22 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Wed, 14 Aug 2013 18:22:14 +0000
(19:22 +0100)
dgit
patch
|
blob
|
history
diff --git
a/dgit
b/dgit
index 072f8586877634cb24e6433bc8e5f8d21bdfc68f..55cdc0c2f37217cda45d7f38f933f7a321f2de40 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-216,10
+216,14
@@
END
my $lastupl_ref = "refs/remotes/$remotename/upload/$suite";
my $lastupl_ref = "refs/remotes/$remotename/upload/$suite";
-sub is_fast_ff ($$) {
+sub rev_parse ($) {
+ return cmdoutput qw(git rev-parse --), "$_[0]~0";
+}
+
+sub is_fast_fwd ($$) {
my ($ancestor,$child) = @_;
my $mb = cmdoutput qw(git merge-base), $dsc_hash, $lastupl_hash;
my ($ancestor,$child) = @_;
my $mb = cmdoutput qw(git merge-base), $dsc_hash, $lastupl_hash;
- return
$mb eq $ancestor
;
+ return
rev_parse($mb) eq rev_parse($ancestor)
;
}
sub fetch_from_archive () {
}
sub fetch_from_archive () {
@@
-238,7
+242,7
@@
sub fetch_from_archive () {
if ($lastupl_hash) {
die "not fast forward on last upload branch!".
" (archive's version left in DGIT_ARCHIVE)"
if ($lastupl_hash) {
die "not fast forward on last upload branch!".
" (archive's version left in DGIT_ARCHIVE)"
- unless is_fast_f
f
($lastupl_hash, $dsc_hash);
+ unless is_fast_f
wd
($lastupl_hash, $dsc_hash);
}
if ($lastupl_ref ne $hash) {
cmdoutput qw(git update-ref -m), 'dgit fetch', $lastupl_ref, $hash;
}
if ($lastupl_ref ne $hash) {
cmdoutput qw(git update-ref -m), 'dgit fetch', $lastupl_ref, $hash;